Copying VFP 8 tables to an Access MDB

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: RichG (anonymous_at_discussions.microsoft.com)
Date: 05/25/04


Date: Mon, 24 May 2004 21:01:06 -0700

I posted a message earlier concerning attaching to a VFP 8 directory as a database. I was able to do so but my ADO knowledge is limited.
I was able to open a dbf in ADO courtesy of Cindy

            con.ConnectionString = _
                "Data Source=" & dbfPath & ";" & _
                "Provider=""VFPOLEDB.1"";"
    
            con.CursorLocation = adUseClient
            con.Mode = adModeRead
            con.Open
    
'Get the names of the dbf's one at a time...................
            dbfName = Dir(dbfPath & "\*.dbf")
            While Not Len(dbfName) = 0

'Strip off the .DBF from the name...........
                dbfName = Left(dbfName, InStr(dbfName, ".") - 1)

             
'This works..................I can read a field name and value
                Set rst = con.Execute("SELECT * From " & dbfName)
                If Not rst.BOF Then
                    

'I would like to replicate the dbf in an MDB with the following but I get a syntax error.

                    con.Execute ("SELECT " & dbfName & ".* INTO " & dbfName & " " & _
                        "IN 'C:\TEMP\Temp\AccuPrint\vfl.mdb' " & _
                        "From " & dbfName & "")

This is a common SQL syntax but it fails in ADO.
Does this usually work in ADO?????



Relevant Pages

  • Using a Select Query to build a MDB table from a Fox table
    ... My ADO knowledge is limited and I'm not sure how a DBF table responds compared to an MDB table. ... This is a common SQL syntax but it fails here ...
    (microsoft.public.fox.helpwanted)
  • Re: DBF to ADO
    ... I used the TTable.BatchMove with the batAppendUpdate mode to create a new ... DBF table that holds all the records. ... Gilles ... >I have to merge several DBF tables into an ADO ...
    (borland.public.delphi.database.ado)
  • Re: BDE and ADO
    ... I would like to insert all the records from ADO into ... > DBF using SQL ... If transfer records from DBF to ... I didn't checked the syntax, ...
    (borland.public.delphi.database.ado)
  • BDE and ADO
    ... I have two databases. ... I would like to insert all the records from ADO into DBF using SQL ... If transfer records from DBF to DBF, ...
    (borland.public.delphi.database.ado)