Weird Stored Proc Problem (ADO)

Results 1 to 2 of 2

Thread: Weird Stored Proc Problem (ADO)

  1. #1
    Join Date
    Dec 1969

    Default Weird Stored Proc Problem (ADO)

    &nbsp;<BR>Hello,<BR>Could someone kindly offer help with a problem that&#039;s driving me crazy.<BR><BR>Here&#039;s my code<BR><BR>&#039;i dont think all these are necessary, i was just <BR>&#039;trying different stuff<BR>rs.cursortype = adopendynamic<BR>rs.cursorlocation = aduseclient<BR>rs.ActiveConnection = cn<BR><BR>&#039;if i use these two lines, it will NOT work<BR>sSql = "sp_myGetQuotes " & myQuoteID & "," & myQuoteID2<BR>rs.Open sSql, , adOpenDynamic, adLockOptimistic, adCmdText<BR><BR>* so the problem is with the sSql (tho the SQL it contains is perfectly correct)<BR><BR>&#039;If I use this, it will work, so the problem above is with the <BR>&#039;first parameter to rs.Open, ie sSql<BR>rs.Open "SELECT * FROM AUTHORS", , adOpenDynamic, adLockOptimistic, adCmdText<BR><BR>I am sure that the stored procedure retrieves records. There is no typo or anything. It&#039;s some tricky ADO stuff.<BR><BR>This didn&#039;t work either (using actual contents of sSql in rs.Open instead):<BR>rs.Open "sp_myGetQuotes " & myQuoteID & "," & myQuoteID2<BR>, , adOpenDynamic, adLockOptimistic, adCmdText<BR><BR>(I had the same problem with another call to another sproc in the same script, and this fixed it - putting actual SQL instead of sSql in rs.Open - but that other sproc had no parameters. Neither proc has any output parameters. MyQuoteId and myQuoteId2 have valid values as well. If I response write that sSql statement and execute it in sQL server, it works perfectly fine.)<BR><BR>The error I&#039;m getting, btw, is the following:<BR><BR>ADODB.Recordset error &#039;800a0e78&#039; <BR>Operation is not allowed when the object is closed. <BR><BR>Please help. Thank you VERY much.<BR><BR>Emir<BR>

  2. #2
    Join Date
    Dec 1969

    Default Missing proper constant arguement

    oRec.Open sSQL,oCon,adOpenStatic,adLockReadOnly,adCmdStoredP roc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts