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"