Stored Procedures

S

SmogerP

I am running a stored procedure to update tables and return the record id of
the record that was just entered. I am having issues on the Stored Procedure
seems to work differently when I run it straight out and when I step thru the
code.

Here is the partial code I am utilizing:
sSPName = "spCreateFromExisting_CA_to_UP
MyQuery.sql = "Exec " & sSPName & " '" & sNCLFileNo & "', Null"
MyQuery.ReturnsRecords = True

Set rs3 = MyQuery.OpenRecordset()

If I step thru the code thru this, the tables are updated correctly. I can
take the MyQuery.sql from Debugger and run it utilizing SQL Query Analyer and
the tables also are updating correctly.

If I run the code straight thru, I have a table that doesn't get updated.
Being I can run this by stepping thru the code and from the SQL Query
Analyzer, I am thinking it is an Access thing.

Anyone have any suggestions?

Thanks in advance.

Phill Smoger
[email protected]
 
B

Brian

SmogerP said:
I am running a stored procedure to update tables and return the record id of
the record that was just entered. I am having issues on the Stored Procedure
seems to work differently when I run it straight out and when I step thru the
code.

Here is the partial code I am utilizing:
sSPName = "spCreateFromExisting_CA_to_UP
MyQuery.sql = "Exec " & sSPName & " '" & sNCLFileNo & "', Null"
MyQuery.ReturnsRecords = True

Set rs3 = MyQuery.OpenRecordset()

If I step thru the code thru this, the tables are updated correctly. I can
take the MyQuery.sql from Debugger and run it utilizing SQL Query Analyer and
the tables also are updating correctly.

If I run the code straight thru, I have a table that doesn't get updated.
Being I can run this by stepping thru the code and from the SQL Query
Analyzer, I am thinking it is an Access thing.

Anyone have any suggestions?

Thanks in advance.

Phill Smoger
[email protected]

I can't really see how it could be an Access thing. The first thing to try
would be to use the SQL Profiler to see what's actually arriving at the
server.
 
Top