abdullauthan
Programmer
Please help me with the Stored Procedure Question. I could not open the recordset.
*** Stored Procedure ***
CREATE PROCEDURE sp_CategoryByCode
@CategoryCode Varchar(10)
AS
Select * From ID_Category
Where Category_Code=@CategoryCode
*** VB Code ***
Dim cnInv as New ADODB.Connection
Dim cmCategory As New ADODB.Command
Dim rstCategory As New ADODB.Recordset
cnInv.Open "Driver={SQL Server};Server=MyServer;Database=MyDB;Uid=sa;Pwd=pwd;"
cmCategory.Activeconnection=cnInv
cmCategory.CommandType = adCmdStoredProc
cmCategory.CommandText = "sp_CategoryByCode '" & txtCategoryCode.Text & "'"
rstCategory.Open cmCategory
*************
When I check for rstCategory.RecordCount, it's returning -1.
*** Stored Procedure ***
CREATE PROCEDURE sp_CategoryByCode
@CategoryCode Varchar(10)
AS
Select * From ID_Category
Where Category_Code=@CategoryCode
*** VB Code ***
Dim cnInv as New ADODB.Connection
Dim cmCategory As New ADODB.Command
Dim rstCategory As New ADODB.Recordset
cnInv.Open "Driver={SQL Server};Server=MyServer;Database=MyDB;Uid=sa;Pwd=pwd;"
cmCategory.Activeconnection=cnInv
cmCategory.CommandType = adCmdStoredProc
cmCategory.CommandText = "sp_CategoryByCode '" & txtCategoryCode.Text & "'"
rstCategory.Open cmCategory
*************
When I check for rstCategory.RecordCount, it's returning -1.