Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / October 2004



Tip: Looking for answers? Try searching our database.

executing packages of Oracle in VB 6.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eitan - 28 Oct 2004 21:19 GMT
Hello,
How can I execute oracle packages in VB 6.0
(I am using Microsoft ActiveX data objects library - ADO)
Need sample code, please

Thanks :)
Al Reid - 29 Oct 2004 12:29 GMT
> Hello,
> How can I execute oracle packages in VB 6.0
> (I am using Microsoft ActiveX data objects library - ADO)
> Need sample code, please
>
> Thanks :)

Here is a working example, clipped from a real project:

Public Function RetrieveAccessAvailable(ByRef cn As ADODB.Connection, _
                                       ByVal UserName As String, _
                                       ByVal ProjectNumber As String) As Recordset

On Error GoTo ERROR_HANDLER

  Dim rs     As Recordset
  Dim adoCmd As ADODB.Command

  If cn.State <> adStateOpen Then
     cn.Open
  End If

  Set adoCmd = New ADODB.Command

  With adoCmd
      Set .ActiveConnection = cn
     .CommandType = adCmdStoredProc
     .CommandText = "CHAPCAPTURE.CHAPCAPTURE_PKG.RetrieveAccessAvailable"
     .Parameters.Append .CreateParameter("oReturn", adVarChar, adParamOutput, 50) 'return code
     .Parameters.Append .CreateParameter("inUserName", adVarChar, adParamInput, 25, UCase(UserName))
     .Parameters.Append .CreateParameter("inProjectNumber", adVarChar, adParamInput, 25, ProjectNumber)
     Set rs = .Execute
  End With

  Set RetrieveAccessAvailable = rs

EXIT_HANDLER:

  Set rs = Nothing
  Set adoCmd = Nothing
  Exit Function

ERROR_HANDLER:

  goLogger.LogEvent Err.Description & " In DataAccess::RetrieveAccessAvailable"l, Err.Number
  goLogger.LogADOErrors cn
  Resume EXIT_HANDLER

End Function

I hope this helps.

Signature

Al Reid

How will I know when I get there...
If I don't know where I'm going?

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.