473,387 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 5315
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sean Anderson | last post by:
ODBC under System DSN Setup Access Driver give it the DSN (Data Source Name) MSA Click on Select and point to the myfile.mdb (your database file)
2
by: Lyn Duong | last post by:
hi all, I am trying to create a dts package to transfer data from tables in my sql server 2000 database to a db2 UDB v8.1.4 database. When I use ibm db2 oledb driver for the destination this...
0
by: Tony Do | last post by:
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...
3
by: Andrew McGregor | last post by:
Hi, I am trying to get a VB.NET application to connect to a local Oracle 9i Lite database. What is the correct form for a connect string? cn = New...
2
by: somersbar | last post by:
im trying to get a basic ASP.NET application running. im trying to display data from a microsoft access database on my web form. im trying to bind the data to a data-grid. but i get the following...
5
by: somersbar | last post by:
hello all, im trying to connect to a microsoft access database from an ASP.NET web form. i keep getting the following error though: ERROR Could not use '(unknown)'; file already in use....
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
2
by: 111mike | last post by:
Hello, Here's my problem. I cannot connect to mysql database using odbc string connections or dns. I keep getting a "cannot connect to mysql server localhost." I'm running windows XP Pro and...
3
by: zombiechewtoy | last post by:
I'm having trouble making an ODBC connection using VB.NET 2005. I have tried nearly every connection string found on connectionstrings.com, in almost every format I can think of. I have tried...
0
by: sudhaoncyberworld | last post by:
Dear Techies, I do have small issue on connecting oracle server from .net This is the code snippet public string strConString = "Driver={Microsoft ODBC for...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.