Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Stored Procedures and VB
On 26 Aug 1998 15:31:41 GMT, M.Rapier_at_shef.ac.uk (Martin Rapier)
wrote:
Hello Martin,
If you want to call a stored procedure from VB5.0,
maybe you could try this:
'with rdoResultset,execute Stored Procedure by OpenResult 'cn is rdoConnection and rs is rdoResultset 'Proc_name is procedure name 'Text1.Text and Text2.Text are IN parameters
SQL= "{ call Proc_name('" & Text1.Text & "','" & Text2.Text & "') } "
Set rs = cn.OpenResultset(SQL)
rs.Close
Response = MsgBox("OK!", vbOKOnly)
'with rdoQuery,execute Stored Procedure by qd.Execute 'qd is rdoQuery
Set qd.ActiveConnection = cn
SQL = "{ call Proc_name('" & Text1.Text & "','" & Text2.Text & "') } "
qd.SQL = SQL
If qd.Prepared = True Then
qd.Execute (rdExecDirect)
Response = MsgBox("OK!", vbOKOnly)
End If
Hope this helps!
I try it successfully calling storedproc by RDO object.
Violin.
violin.hsiao_at_mail.pouchen.com.tw
>I know that this one comes up time and time again, but could someone remind me
>how to call a stored procedure from Visual Basic?
>
>Ordinary SQL is no problem, but I want to modify an old VB system
>monitor program a colleague wrote to allow me to execute
>dbms_system.set_sql_trace_in_session for user sessions. I believe you have to
>muck around explicitly embedding 'begin' & 'end' statements terminated by
>CR/LFs?? A code example would be v. handy.
>
>Cheers
>Martin
Received on Wed Aug 26 1998 - 22:40:13 CDT
![]() |
![]() |