Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling an Oracle Stored Procedure from VB

Status
Not open for further replies.

SirPacs

Programmer
Feb 11, 2000
2
0
0
US
I need help. I have an ODBC connection to an oracle database. I am loading data into some tables there. I now need to call a stored procedure in Oracle to process these records. Can any one give me an example or tell me where to go to get the anwser I need. Thanks.
 
I'm not really an ODBC person (we use Oracle Objects for OLE, it's faster) so this might be a stupid question.<br>
<br>
Don't you have an ExecuteSQL call in ODBC? If so you could call the procedure as normal<br>
<br>
exec ProcedureName(param1,param2);<br>
<br>
Mike<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Dim conn As ADODB.Connection<br>
Dim rs As ADODB.Recordset<br>
Dim txt As String<br>
Dim fld As Field<br>
<br>
' Open a connection using Oracle ODBC.<br>
Set conn = New ADODB.Connection<br>
conn.ConnectionString = _<br>
&quot;Driver={Microsoft ODBC for Oracle};&quot; & _<br>
&quot;UID=user_name;PWD=user_passsword&quot;<br>
conn.Open<br>
<br>
' Open the FuelTypes table.<br>
Set rs = New ADODB.Recordset<br>
rs.Open &quot;TableName&quot;, conn, adOpenDynamic, adLockOptimistic, adCmdTable<br>
<br>
' List the data.<br>
Do While Not rs.EOF<br>
txt = &quot;&quot;<br>
For Each fld In rs.Fields<br>
txt = txt & Trim$(fld.Value) & &quot;, &quot;<br>
Next fld<br>
If Len(txt) &gt; 0 Then txt = Left$(txt, Len(txt) - 2)<br>
List1.AddItem txt<br>
rs.MoveNext<br>
Loop<br>
<br>
rs.Close<br>
conn.Close<br>
<br>
Eric <p>Eric De Decker<br><a href=mailto:vbg.be@vbgroup.nl>vbg.be@vbgroup.nl</a><br><a href= Basic Center</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top