exporting ADODB.recordset to DBF file?

Results 1 to 2 of 2

Thread: exporting ADODB.recordset to DBF file?

  1. #1
    Join Date
    Dec 1969

    Default exporting ADODB.recordset to DBF file?

    Hi,<BR><BR>I&#039;m trying to export an ADO recordset (from an Access db) to a dbf file. I&#039;m doing this via ASP. <BR><BR>Anyone ever done something like this? <BR><BR>Thanks, David<BR>

  2. #2
    Join Date
    Dec 1969

    Default Should be doable...

    And you can do it, really, without the intervention of ASP.<BR><BR>You just have to specify your Access SQL statement properly.<BR><BR>The JET driver is capable of understanding multiple kinds of databases, including DBF. So you could either:<BR><BR>(1) open the connection to DBF. Then use a SQL statement something like:<BR><BR>INSERT INTO tablename <BR>SELECT &#060;fields&#062; FROM tablename IN xyz.mdb WHERE &#060;condition&#062;<BR><BR>(2) open the connection to the Access database. Then use a SQL statement something like:<BR><BR>SELECT &#060;fields&#062; FROM tablename <BR>INTO filename.dbf IN "C:path odbasefiles" "dBASE IV;" <BR>WHERE &#060;condition&#062;<BR><BR>Where you substitute the actual path and filename, etc. (The string "dBASE IV" must be used as is, though, according to my docs.)<BR><BR>**********<BR><BR>You can try the latter of these right in Access, just be creating the SQL query in the query designer. You&#039;ll get more "help" from Access that way and you can play with until you get it right.<BR><BR>********<BR><BR>Here&#039;s a copy/paste from my Access97 docs:<BR><BR>Remarks<BR><BR>You can use IN to connect to only one external database at a time.<BR><BR>In some cases, the path argument refers to the directory containing the database files. For example, when working with dBASE, FoxPro, or Paradox database tables, the path argument specifies the directory containing .dbf or .db files. The table file name is derived from the destination or tableexpression argument.<BR><BR>To specify a non-Microsoft Jet database, append a semicolon (;) to the name, and enclose it in single (&#039; &#039;) or double (" ") quotation marks. For example, either &#039;dBASE IV;&#039; or "dBASE IV;" is acceptable.<BR><BR>You can also use the DATABASE reserved word to specify the external database. For example, the following lines specify the same table:<BR><BR>... FROM Table IN "" [dBASE IV; DATABASE=C:DBASEDATASALES;];<BR>... FROM Table IN "C:DBASEDATASALES" "dBASE IV;"<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts