Click to See Complete Forum and Search --> : Access Passthrough


gbalakri
February 3rd, 2003, 01:30 PM
I have a Stored Procedure in a Sybase database and I have
created an SQL pass through query in Access 2000 to run
the procedure. When I run the pass through query in
vbscript using ADO the stored procedure gets executed
twice( I see it in the ODBC logs). If I use DAO the procedure only gets executed once.
The same issues occurs with SQL server also. Does any one
know how to solve this problem. Attached is the function
that I use

Function RunSql()
Dim rs As Object
Dim cm As Object
Dim stSql As String
Dim iCnt As Integer

Set con = Application.CurrentProject.Connection
stSql = "SELECT * FROM MstLotListQry"
Set cm = CreateObject("ADODB.Command")
cm.ActiveConnection = con
cm.CommandText = stSql
cm.CommandType = adCmdText
cm.Execute iCnt
End Function

antares686
February 10th, 2003, 03:03 PM
Can you give me a bit of detail on the connection parameters defined by

Application.CurrentProject.Connection

also, you say duplicates on SQL Server, have you tried runniong SQL Profiler for SQL Server to verify it is actually running twice on the server side?