472,141 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

ODBC Net driver throw an exception

Does anyone have problem of running stored procedure from VB .NET using the
ODBC driver, The OleDB driver work OK with the same Stored Procedure, also
the ASP work OK with that same Stored Procedure.

Here is the VB .NET Code

Dim constr as String =
"DSN=UPLUS;UID=db2admin;PWD=office;MODE=SHARE;DBAL IAS=UPLUS;PATCH2=6;PATCH1=
1024;LOBMAXCOLUMNSIZE=1048575;LONGDATACOMPAT=1;"
Dim OConnection as New System.Data.ODBC.ODBCConnection(constr)
Dim OCommand As New System.Data.ODBC.ODBCCommand("InsertAreturn10",
OConnection)
OCommand.CommandType = CommandType.StoredProcedure
OConnection.open()
OCommand.ExecuteNonQuery()
OConnection.close()

Produce the error
ERROR [42601] [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token
"END-OF-STATEMENT" was found following "InsertAreturn10". Expected tokens
may include: "JOIN <joined_table>". SQLSTATE=42601
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [42601] [IBM][CLI
Driver][DB2/NT] SQL0104N An unexpected token "END-OF-STATEMENT" was found
following "InsertAreturn10". Expected tokens may include: "JOIN
<joined_table>". SQLSTATE=42601
Where as the following code (OleDB driver) run fine

Dim constr as String ="Provider=IBMDADB2.1;Password=office;Persist Security
Info=True;User ID=db2admin;Data Source=UPLUS"
Dim OConnection as New System.Data.OleDb.OleDbConnection(constr)
Dim OCommand As New System.Data.OleDB.OleDbCommand("InsertAreturn10",
OConnection)
OCommand.CommandType = CommandType.StoredProcedure
OConnection.open()
OCommand.ExecuteNonQuery()
OConnection.close()
Nov 12 '05 #1
1 5213
stant
2
Tony, have you made progress on this issue? I am having the exact same problem with a c# console app, but my stored proc also accepts parameters. I wonder if you are going to begin experiencing a different problem with oledb once you introduce params. Please email me at stan_r_teitelbaum@progressive.com to ensure that i get your response.
Jun 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sean Anderson | last post: by
reply views Thread by Tony Do | last post: by
3 posts views Thread by Andrew McGregor | last post: by
2 posts views Thread by somersbar | last post: by
5 posts views Thread by somersbar | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.