Results 1 to 3 of 3

Thread: sp's. Can't get Recordset

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    154
    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

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    16

    ? Not sure if this will help

    instead of trying to write "... = null"

    try "... = vbNullString" I'm not sure if this is write, but it may work.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    154
    That is not accepted in SQL server but thanks for the reply!!

Posting Permissions

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



Click Here to Expand Forum to Full Width