0

I had stored procedure MySPOld in Sybase db. I created new sp MySP. This new sp returns data while executed from Sybase Sql Advantage. But not returning the data when called from VBA - Excel 2003 (EOF property of recordset is True). Here is my code..

Dim dbCon As ADODB.Connection
Dim rstTemp As New ADODB.Recordset
Dim query As String
query = "exec MySP '01/01/2010', '01/14/2010'"
dbCon.Open connectionString, "username" "password"
dbCon.CommandTimeout = 300
rstTemp.Open query, dbCon, adOpenForwardOnly

The code was working well with old sp. What could be the problem ? any idea ?

Thanks in Advance.

2
  • @Sam so why not mark @Adamh as your accepted answer? Commented Jan 13, 2010 at 22:05
  • Sorry Remou, actually I did not know how to mark the answer as "Accepted". Done now.. Commented Jan 15, 2010 at 13:07

1 Answer 1

3

Am assuming it works ok from isql or sql advantage!

Do you compare with null anywhere in the new procedure? I've found previously that statements like "if @var = null" behave differently when called from isql etc, compared with via VBA or vbScript. If you have something like this just change it to "if @var is null" and it'll work.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you very very very much Adam. It worked. I spent whole day to figure out the issue. And I wouln't have got solution even if I had spent more... Its very strange that the null value handling is different when SP called from VBA. Generally, when we write SP, we dont take front end Application into consideration. Anyway, Thanks once again ! ! !
Glad it worked for you, I never bothered trying to find out exactly why once I found the answer. Mark the answer as the answer if you're happy it is the answer - then i can get some badly needed points! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.