Re: Can i use stored procedures with VB and How ???
seeralan maskarnas wrote:
> I want to use stored procedures with Visual Basic
> 6.0..
> Is it possible to call stored procedures from
> VB..
> How???? pls reply
------>>
Dim cmd As ADODB.Command
Dim rstemp As ADODB.Recordset
Dim strMyName As String
strMyName = "Nadz"
Set cmd = Nothing
Set cmd = New ADODB.Command
Set rstemp = Nothing
Set rstemp = New ADODB.Recordset
cmd.ActiveConnection = conn
cmd.ActiveConnection.CursorLocation = adUseClient
cmd.CommandTimeout = 0
cmd.CommandType = adCmdText
'construct MySQL call for stored procedure
cmd.CommandText = "call simpleproc(@a,@b,'" & strMyName & "') ;"
'call the stp
cmd.Execute
'get the outputs
cmd.CommandText = " SELECT @b,@a ;"
'Place the output param into recordset
Set rstemp = cmd.Execute
'the 2nd param
MsgBox rstemp.Fields(0).Value & vbNullString
'the 1st param
MsgBox rstemp.Fields(1).Value & vbNullString
Set cmd = Nothing
Set rstemp = Nothing
<<---
Edited 1 time(s). Last edit at 02/15/2006 08:01AM by ronald dela cruz.
Subject
Views
Written By
Posted
2412
January 06, 2006 05:50AM
Re: Can i use stored procedures with VB and How ???
1695
February 15, 2006 07:33AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.