ADO Execute pass-thru query inserting data into local table

  • Thread starter Thread starter Jay Myhre
  • Start date Start date
J

Jay Myhre

I am converting some Access97 code into ADO but haven't figured out how to
convert the following (which works just fine but know it could have been
coded better):
---------------------------------------------------------------------------------
Dim myQuery as QueryDef, myDB as Database
Set myDB = CurrentDb
Set myQuery = myDB.CreateQueryDef("MyODBCQuery")
myQuery.connect = " (connection string goes here) "
myQuery.ReturnsRecords = True
myQuery.SQL = "{Call Flag_DE_1_Get_PCR('" & Forms!fmPCR!Provider & "')}"
myDB.Execute "INSERT INTO [MainPCR] SELECT * FROM myODBCQuery"
----------------------------------------------------------------------------------

I can execute the pass-through query but haven't figured out how to get the
resulting new Recordset to insert the data into the local table MainPCR.

Thanks, Jay
 
uh, do this on the SQL Server side-- that way you can write the tables
to whatever database you want.

Jet is obsolete, and it has been for a decade

-Aaron
 
Back
Top