Accessing SQL Server Procs from VB5 
Author Message
 Accessing SQL Server Procs from VB5

Hello All,

        I have a problem accessing a SQL Server Procedure from VB5

my proc is small:      

create proc titlesbyauthor


as

        select au_lname
        from authors

I am using a rdoConnection in VB.
I have VB setup to link to the SQL Server Proc just fine
my problem is in accessing the data.. I am reading  the hitchhikers
guide.
The author talks about getting  an "Invalid use of NULL error" when it
is setup
like this:

Dim ucTest As New UserConnection1
Dim rs As rdoResultset

Private Sub Command1_Click()
Dim RETURN_VALUE As Integer
Dim lrc As Long
lrc= ucTest.titlesbyauthor("White")  **error occurs**
End Sub

so, he talks about  declaring the variable to capture the value as a
variant.
But, in this case you have to test for NULL in case the Stored Proc
doesnt
return the status value until later. So I tried this.

Dim ucTest As New UserConnection1
Dim rs As rdoResultset

Private Sub Command1_Click()
Dim RETURN_VALUE As Integer
Dim lrc As Long
Dim vRetVal As Variant
Do While vRetVal = Null
    vRetVal = ucTest.titlesbyauthor("White")
Loop
datafound(0) = RETURN_VALUE
datafound(1) = vRetVal

End Sub

I can only return the RETURN_VALUE my vRetVal is coming up
empty but, I am not getting any errors
could anyone direct me the right way. Or tell me a better way to access
procedures using RDO from VB5. Thanks!!!!!!!!!!!!! Chip



Sun, 13 Feb 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Locking in VB5 and SQL Server 6.5 using stored procs

2. Executing MS SQL Server 2000 stored procs via MS Access 2000

3. Calling Stored Procs from SQL Server

4. SQL Server stored procs w/ ADO

5. VB Sybase/SQL Server Stored Procs Question

6. Can't see all stored procs in SQL server

7. Stored Procs in SQL Server

8. Issue with OCX and SQL Server Stored Procs?

9. Proplem with VB + CR + SQL Server(stored procs)

10. SHAPE problem with Stored Procs in SQL Server

11. SQL Server 6.5 Stored Procs

12. SQL Server 6.5 Stored Procs

 

 
Powered by phpBB® Forum Software