Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006

    Unanswered: Copying VFP table into Access

    Hi all... I've been trying to copy a VFP table into an Access database and I haven't had much success... The code I'm using below returns a "Syntax Error" in the SQL statement. If I reduce the SQL statement from an "INSERT INTO" to just a plain "SELECT * FROM eg", it doesn't bomb out, but it also doesn't produce anything. The DSN I'm using (vfp151) is configured as an ODBC connection on my machine. I'm trying to copy the contents from some foxpro free tables into an access mdb. The reason I am not linking or importing is because the foxpro table names could be different, as could the target mdb. I need to be able to pass the name of the vfp table and the name/path of the destination mdb to the sub/function. Once I get this "static" code working, I'll modify it so that the table names are passed as variables. Here's the code from what I'm trying to do ("us" is the name of a table in the target mdb, "eg" is the name of the source vfp table):

    Dim oConn As ADODB.Connection
    Set oConn = New ADODB.Connection
    oConn.ConnectionString = "Provider=vfpoledb;DSN=vfp151"
    oConn.Execute "INSERT INTO us IN 'c:\test\elec151\search.mdb' SELECT * FROM eg"

    Thanks in advance!
    Last edited by Syvman; 03-16-06 at 13:47.

  2. #2
    Join Date
    Feb 2006
    Is it possible that action queries are not allowed when dealing with the VFP odbc connection?

Posting Permissions

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