Steve Thomas
Apr 7th, 2000, 02:42 AM
Following is my Stored Procedure:
CREATE PROCEDURE [sp_CheckForCar]
AS
SELECT DT_Completed, Wqueue, AcctNum, TReq
FROM tMaster
WHERE DT_Completed = null
I have about 5,000 records in tMaster that I know have a DT_Completed that is Null.
Following is how I am calling the sp_CheckForCar from VB5:
Private Sub Command4_Click()
Dim cn As New ADODB.Connection
Dim cm As New ADODB.Command
Dim rs As New ADODB.Recordset
cn.Open "provider=SQLOLEDB.1;" & _
"Password=;" & _
"Persist Security Info=False;" & _
"User Id=sa;" & _
"Initial Catalog=TPO;" & _
"Data Source=SLC-CUSTSQL"
cm.CommandText = "sp_CheckForCar"
Set cm.ActiveConnection = cn
Set rs = cm.Execute
If rs.AbsolutePosition = 0 Then
MsgBox "Records Found"
Else
MsgBox "No Records Found"
End If
End Sub
I keep getting NO Records Found (AbsolutePosition = -1)
Any help would be appreciated.
P.S. I would prefer that the sp simply supply me with Records Found or No Records Found rather than retrieving a recordset. I am still learning about Input and Output on SQL but if you have suggestion that would be great.
Thanks
CREATE PROCEDURE [sp_CheckForCar]
AS
SELECT DT_Completed, Wqueue, AcctNum, TReq
FROM tMaster
WHERE DT_Completed = null
I have about 5,000 records in tMaster that I know have a DT_Completed that is Null.
Following is how I am calling the sp_CheckForCar from VB5:
Private Sub Command4_Click()
Dim cn As New ADODB.Connection
Dim cm As New ADODB.Command
Dim rs As New ADODB.Recordset
cn.Open "provider=SQLOLEDB.1;" & _
"Password=;" & _
"Persist Security Info=False;" & _
"User Id=sa;" & _
"Initial Catalog=TPO;" & _
"Data Source=SLC-CUSTSQL"
cm.CommandText = "sp_CheckForCar"
Set cm.ActiveConnection = cn
Set rs = cm.Execute
If rs.AbsolutePosition = 0 Then
MsgBox "Records Found"
Else
MsgBox "No Records Found"
End If
End Sub
I keep getting NO Records Found (AbsolutePosition = -1)
Any help would be appreciated.
P.S. I would prefer that the sp simply supply me with Records Found or No Records Found rather than retrieving a recordset. I am still learning about Input and Output on SQL but if you have suggestion that would be great.
Thanks