Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-03-04 : 13:57:38
|
| Matthew writes "I am having a problem here my vbs file is not detecting the eof of the recordset. I'm not sure whats wrong because the following code works with a different stored procedure..subscriberssubject.open "getsubscriberssubjects " & emailid, adOpenKeyset,adLockReadOnlydo until subscriberssubject.eofthenewbooks.open "exec emailsubject " & subscriberssubject.fields("subjectid"),cn,adOpenKeyset, adLockReadOnlyif not thenewbooks.eof thenbodystring = bodystring & vbcrlf & ucase(subscriberssubject.fields("subjectname")) & vbcrlfdo until thenewbooks.eofsendmail = 1bodystring = bodystring & "Title: " & thenewbooks.fields("title") & vbcrlfbodystring = bodystring & "Author: " & thenewbooks.fields("author") & vbcrlfbodystring=bodystring & vbcrlfthenewbooks.movenextloopthenewbooks.closeend ifsubscriberssubject.movenextloopsubscriberssubject.close the emailsubject SP uses a simple select statement with a parameter.the other stored procedure i put into emailsubjects place is a bit more complicated and generated a dynamic where clause and uses sp_executesql... does anyone have any idea why the sp_executesql query makes the recordsets almost ineffective. the recordset does not get anything from the database- and the query does work fine in query analyzer" |
|
|
andre
Constraint Violating Yak Guru
259 Posts |
Posted - 2002-03-05 : 09:51:27
|
quote: does anyone have any idea why the sp_executesql query makes the recordsets almost ineffective. the recordset does not get anything from the database- and the query does work fine in query analyzer
Do you have SET NOCOUNT ON at the beginning of your stored procedure? |
 |
|
|
rrb
SQLTeam Poet Laureate
1479 Posts |
Posted - 2002-03-05 : 17:08:06
|
quote: Do you have SET NOCOUNT ON at the beginning of your stored procedure?
Alternatively, have you SET NOCOUNT OFF at the beginning of your stored procedure....--I hope that when I die someone will say of me "That guy sure owed me a lot of money" |
 |
|
|
|
|
|