|
-
Nov 30th, 2012, 12:01 PM
#1
Thread Starter
New Member
ODBC Driver For Oracle That Executes Multiple Statements
I am writing a VB2010 app that reads a SQL command file that contains multiple SQL statements. I've tried multiple ODBC drivers but can't find one that executes multiple statements. Does anyone have any ideas? Am I going down the wrong path?
Sample Code:
' Define variables:
Dim dbORA As New OdbcConnection
Dim rsORA As New OdbcCommand("", dbORA)
Dim srORA As StreamReader
' Create connection string & open connection:
dbORA.ConnectionString = "Driver={Oracle in OraClient11g_home1};Dbq=dbname;Uid=username;Pwd=password;"
dbORA.Open()
' Create streamreader to read SQL statements and store statements in ODBC command variable:
srORA = New StreamReader("C:\statements.sql")
rsORA.CommandText = srORA.ReadToEnd
srORA.Close()
' Execute SQL statements:
rsORA.ExecuteNonQuery()
' Error message:
ERROR [HY000] [Oracle][ODBC][Ora]ORA-00922: missing or invalid option
The error message is misleading because the SQL statements are valid and can be run via SQL Developer or another Oracle utility
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|