473,473 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 5319
stant
2 New Member
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: 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
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.