ADO Execute pass-thru query inserting data into local table

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
 
A

a a r o n _ k e m p f

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top