
RDO, SQL Server & Stored Procedures
Chris, for returned values you will need to set the direction property of
the rdoParameter as a return value prior to executing the stored procedure.
(from the VB4 Help file)
Dim my_statement As rdoPreparedStatement
Set my_statement = someRdoConnection.CreatePreparedStatement _
("MyPs", "{?=call sp_testprocedure }", ...)
my_statement.rdoParameters(0).Direction = rdParamOutput
my_statement.Execute
Print my_statement.rdoParameters(0).Value
Quote:
> > Don'y know if this is what you want..
> > dim gdb as rdoconnection
> > dim sp as rdoPreparedStatement
> > Set gdb = rdoEnvironments(0).OpenConnection("ODBCSOURCE",
> > rdDriverCompleteRequired, False, "")
> > Set sp = gdb.CreatePreparedStatement("", "{Call
> > StoredProcedure(?,?,?,?,?)}")
> > sp.rdoParameters(0) = value
> > sp.rdoParameters(1) = value
> > sp.rdoParameters(2) = value
> > sp.rdoParameters(3) = value
> > sp.rdoParameters(4) = value
> > sp.Execute
> > Alex
> Alex,
> Thanks for the tip. Yes, I tried the above and had limited success. I
> am able to pass parameters *to* the procedure but can't seem to get it
> right when I need the value to be returned to VB.
> e.g with the stored procedure below
> return
> And in VB, this is how I call it :
> Set ps = gdb.CreatePreparedStatement("", "Execute sp_GetOrderNo ?")
> ps.rdoParameters(0) = OrderNo
> ps.Execute
> The program executes OK (no runtime error) but OrderNo always contains
> the wrong value. (in my case, 0)
> --
> Chris Seah (65) 774 8654
> Information Frontiers Private Limited (Singapore)
> http://www.infront.com.sg