MySQL Forums
Forum List  »  Stored Procedures

Re: Can i use stored procedures with VB and How ???
Posted by: ronald dela cruz
Date: February 15, 2006 07:33AM

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.

Options: ReplyQuote


Subject
Views
Written By
Posted
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.