Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass-through-query is very slow

Status
Not open for further replies.

Muss

Programmer
Apr 27, 2001
2
0
0
US
I'm using ADO to update a pass-through-query to MS SQL and it takes a very long time to execute this line of code from the following procedure to update the query:

Set cmd = cat.Procedures(strQdfName).Command

Furthermore, it appears that when I execute this line of code, other pass-through-queries in the database are executed even though they should not be initiated in any way from this query. I can't understand why this is happening.

Thanks


Dim cat As ADOX.Catalog
Dim cmd As ADODB.Command

Set cat = New ADOX.Catalog
Set cat.ActiveConnection = CurrentProject.Connection

Set cmd = cat.Procedures(strQdfName).Command
cmd.Properties("Jet OLEDB:ODBC Pass-Through Statement") = True
cmd.CommandText = strSql

If Not IsMissing(varConnect) Then
cmd.Properties("Jet OLEDB:pass Through Query Connect String") = CStr(varConnect)
End If

cmd.Properties("Jet OLEDB:pAss Through Query Bulk-Op") = Not fRetRecords

Set cat.Procedures(strQdfName).Command = cmd

Set cmd = Nothing
Set cat = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top