By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

Oracle OLE DB -- Error ORA-00911: invalid character

P: n/a
I am using the following code to insert a row in an Oracle Database.

strConnection = "Provider=OraOLEDB.Oracle;Data Source=MYDATABASE;User
Id=SYSTEM;Password=******"

Dim strMessage As String

Dim objConnection As New OleDb.OleDbConnection(strConnection)

Dim objCommand As OleDb.OleDbCommand
objConnection.Open()

objCommand = New OleDb.OleDbCommand(strSQL, objConnection)

objCommand.ExecuteNonQuery()

objConnection.Close()

Now the strSQL string inserts a row when I cut and paste it in to PLSQL
(SQL+). But when I execute the above code with the same SQL string, I get
an Invalid Character Error. ORA-00911.

Any Ideas??


Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Sun, 17 Aug 2003 22:33:29 -0500, "Barry Young" <yo******@insightbb.com> wrote:

I am using the following code to insert a row in an Oracle Database.

strConnection = "Provider=OraOLEDB.Oracle;Data Source=MYDATABASE;User
Id=SYSTEM;Password=******"

Dim strMessage As String

Dim objConnection As New OleDb.OleDbConnection(strConnection)

Dim objCommand As OleDb.OleDbCommand


objConnection.Open()

objCommand = New OleDb.OleDbCommand(strSQL, objConnection)

objCommand.ExecuteNonQuery()

objConnection.Close()



Now the strSQL string inserts a row when I cut and paste it in to PLSQL
(SQL+). But when I execute the above code with the same SQL string, I get
an Invalid Character Error. ORA-00911.
Any chance you can post the SQL statement? If I had to take a guess it's probably a single quote
character that is causing the problem.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 19 '05 #2

P: n/a
Paul,

Error: Invalid Character Error. ORA-00911.
Now the strSQL string inserts a row when I cut and paste it in to PLSQL
(SQL+). But when I execute the above code with the same SQL string via
VB.NET, I get
an Invalid Character Error. ORA-00911.
SQL String (Executed via SQL+):

SQL> INSERT INTO MYDATABASE.tblXY9999Patients (PatientID, MedRecNo,
lname, fname, mi, street, city,
state, zip, ssn, dob, sex, Ethnicity, SocioEconFlag,
PatientHistoryFlag, PatientPrevSurgeryFlag, Sy
nergyProdigyFlag, IPC, DateCreated, DateLastModified, Status,
LogDateTime, LogUserID, LogReason) Val
ues (4669, '999999', 'John', 'XYYSS', 'J', '2410 World Dr', 'New World',
'HV', '99999','000-00-0000'
, to_date('7/5/1955','MM-DD-YYYY'), 'Male', 'African-American', 0, 0, 0,
0, 0, to_date('5/7/2002 2:4
5:28 PM','MM-DD-YYYY HH:MI:SSAM'), to_date('8/13/2003 1:50:07
PM','MM-DD-YYYY HH:MI:SSAM'), 'Before
Change', sysdate, 'djamison','');

1 row created.

SQL>
I am using the following code to insert a row in an Oracle Database via
the VB.NET Oracle.OLEDBConnection.

Here is the VB.NET Code:

strConnection = "Provider=OraOLEDB.Oracle;Data Source=MYDATABASE;User
Id=SYSTEM;Password=******"

Dim strMessage As String
Dim objConnection As New OleDb.OleDbConnection(strConnection)
Dim objCommand As OleDb.OleDbCommand
objConnection.Open()
objCommand = New OleDb.OleDbCommand(strSQL, objConnection)
objCommand.ExecuteNonQuery()
objConnection.Close()

Any Ideas?? Is there a different OLEDB or Oracle .NET provider
available?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.