|
-
November 3rd, 2004, 03:41 PM
#1
Strange Behaviour in ADO, any ideas why this happens?
I have a program that gets data from one table using a Stored Procedure (say sp_StoredProc1) which is working fine. I substituted a different Stored procedure (say sp_StoredProc2) in place of sp_StoredProc1. I got Error: Line 1: Incorrect syntax near 'N'. The Stored Procedures are exactly the same with the exception that they Select from different tables (tables are identitical, just different data). I ran both Queries through QueryAnalyzer, so I know that they both work and return the correct Data. The funny part is that if I remove the parantheses (like sp_StoredProc2 'N'), then the second Query works fine!
I was wondeing if anyone has come across this before? I have already fixed it by removing the parentheses, I'm just interested in finding out why one works and the other doesn't.
Here's a sample of my code (I use ADO 2.5):
Code:
strQuery = "sp_StoredProc1('N')"
Set rsData = Nothing
If rsData Is Nothing Then
Set rsData = cnConnection.Execute(strQuery, 0, adAsyncExecute)
Else
rsData.Requery
End If
If rsData.State <> adStateExecuting Then '<-- Breaks here when I replace sp_StoredProc1 with sp_StoredProc2
'Code Here
End If
I'd rather be wakeboarding...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|