sql server - ADODB RecordCount behaviour changes calling SQL stored procedure with EXEC? -


i'm maintaining vb6 application uses sql server via adodb. rewrote lines

sql = "exec sp_mystoredproc " & format(iparam1) & "," & format(iparam2) call rs.open(sql, cn, 1, 1) 

as

dim cmd new adodb.command cmd.commandtype = adcmdstoredproc cmd.commandtext = "sp_mystoredproc" cmd.parameters.append cmd.createparameter("@iparam1", adinteger, adparaminput, , iparam1) cmd.parameters.append cmd.createparameter("@iparam2", adinteger, adparaminput, , iparam2) cmd.activeconnection = cn rs.open cmd, , 1, 1 

it looked simple..., after change, rs.recordcount returns -1.

i have fixed problem forcing cn.cursorlocation = aduseclient before rs.open statement, question is: does have idea why calling stored procedure via adodb.command of type adcmdstoredproc provides different cursor behaviour sending "exec..." statement server?


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -