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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute a SQL program from VB6

Status
Not open for further replies.

Josselin

Technical User
Feb 14, 2004
33
FR
Hi all,

I am developping with Visual Basic version 6.
In my VB program, I want to launch a SQL program (not a stored procedure).
What is the best way of proceeding?

Thanks in advance for your help.

Josselin
 
Use a ADO Command object's Execute method to send an EXEC command to the server, passing your SQL extended stored procedure (often called a SQL Program) as a parameter.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Hi chiph,

The Oracle program to execute is not a store procedure, but a SQL program containing CREATE TABLE, DROP TABLE instructions.

Thanks for your help.

Josselin
 
I assume you've written a Java program to run on your Oracle 9i or 10g Database?

The Oracle Technology Network ( shows that you call Java programs with the CALL statement:
Code:
SQL> variable myString varchar2[20];
SQL> call helloworld() into :myString;
Their example is from SQL*Plus, but you can issue the same statements in VB6 via an ADO Command object:
Code:
Dim sSQL As String
sSQL = "CALL helloworld()"
adoComm.CommandText = sSQL
Set adoRS = adoComm.Execute

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top