Stored Procedures HELP!! 
Author Message
 Stored Procedures HELP!!

Hello,

        I am having a problem accessing a SQL Server Procedure  from VB5.  I am
using RDO Connections.

The Code is below. And the error is:

Run-time error 40002:

37000:[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot Open
a cursor on a stored procedure that has anything other than a single
select statement in it

Does anyone know what cursor I should use so that I am able to pass 2 or
more
parameters back to my procedure in SQL Server..

My broken down VB5 code:
 ___________________________________________________

Dim GradCon As New UserConnection1
Dim rs As rdoResultset

Private Sub Addcmd_Click()
Dim grd As Long
Dim RETURN_VALUE As Integer

grd = GradCon.New_Student("a11951144", "Shank")

End Sub

Private Sub Form_Load()
'GradCon.CursorDriver = rdUseClientBatch "Remarked OUT!"
GradCon.Connect = "dsn=GraduateDB;uid=sa;pwd=Theman;database=Graduate"
GradCon.EstablishConnection rdDriverNoPrompt, False
End Sub
____________________________________

My Procedure in SQL Server .. needs 2 values

create proc New_Student



as



Thanks for ANY help!!!

Chip



Mon, 14 Feb 2000 03:00:00 GMT  
 Stored Procedures HELP!!

Chip:

You don't want a cursor - it returns data from a "SELECT" statement to your
VB program.  You just want to execute an action statement which doesn't
return data but executes some action like inserting or deleting, in your
example a stored procedure which inserts records into your db.

Try changing:

grd = GradCon.New_Student("a11951144", "Shank")

to

GradCon.Execute "New_Student 'a11951144', 'Shank'", rdExecDirect

--
Bob Kubelka, MCSD



Quote:
> Hello,

>    I am having a problem accessing a SQL Server Procedure  from VB5.  I am
> using RDO Connections.

> The Code is below. And the error is:

> Run-time error 40002:

> 37000:[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot Open
> a cursor on a stored procedure that has anything other than a single
> select statement in it

> Does anyone know what cursor I should use so that I am able to pass 2 or
> more
> parameters back to my procedure in SQL Server..

> My broken down VB5 code:
>  ___________________________________________________

> Dim GradCon As New UserConnection1
> Dim rs As rdoResultset

> Private Sub Addcmd_Click()
> Dim grd As Long
> Dim RETURN_VALUE As Integer

> grd = GradCon.New_Student("a11951144", "Shank")

> End Sub

> Private Sub Form_Load()
> 'GradCon.CursorDriver = rdUseClientBatch "Remarked OUT!"
> GradCon.Connect = "dsn=GraduateDB;uid=sa;pwd=Theman;database=Graduate"
> GradCon.EstablishConnection rdDriverNoPrompt, False
> End Sub
> ____________________________________

> My Procedure in SQL Server .. needs 2 values

> create proc New_Student



> as



> Thanks for ANY help!!!

> Chip



Mon, 14 Feb 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing parameters to stored procedures - help please!

2. Stored Procedure Help in SQL7

3. Stored Procedure Help

4. ADO Stored Procedure Help Plse

5. VB 4.0 - Stored Procedure help wanted

6. ADO and Stored Procedures: help.

7. Stored Procedure Help Needed

8. VB4/DAO/Stored Procedure Help Needed

9. Stored procedures, help anyone?

10. Stored Procedure help

11. stored procedures help!!

12. stored procedures help!!

 

 
Powered by phpBB® Forum Software