感谢dretzlaff17的回答,没有返回记录在记录(VB6)
我giveing细节..........从SQL Server
SP 2005不返回recordSet(VB6)记录中的记录返回-1。如果使用查询和记录集访问记录,记录集将填充记录。
使用相同的连接字符串。我检查得当,在VB6中为命令对象编写的代码没有问题,那么错在哪里?
有什么别的东西,我们必须在访问SQL Server的做2005
我的代码是这样
Dim Conn as new ADODB.Connection
Dim RS as new ADODB.RecordSet
Dim CMD as new ADODB.Command
Conn.Open "Connection String" ' Its working
CMD.ActiveConnection = Conn
CMD.CommandType = adCmdStoredProc
CMD.CommandText = "SPName"
Set RS = CMD.Execute
Debug.Print RS.RecordCount ' /* here result is -1 means CMD is not executing and RS is not filling with records */
and if use
RS.Open "Select query", conn 'then this record set is filling with records.
我也通过RS(光标)位置值设置为客户端检查和SP很简单,只有选择查询出现在SP no中的I/O参数中。
还有一件东西记录存在数据库表中不是空的。
这个您的想法讨好
感谢