473,582 Members | 3,083 Online
Bytes | Software Development & Data Engineering Community
+ 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=of fice;MODE=SHARE ;DBALIAS=UPLUS; PATCH2=6;PATCH1 =
1024;LOBMAXCOLU MNSIZE=1048575; LONGDATACOMPAT= 1;"
Dim OConnection as New System.Data.ODB C.ODBCConnectio n(constr)
Dim OCommand As New System.Data.ODB C.ODBCCommand(" InsertAreturn10 ",
OConnection)
OCommand.Comman dType = CommandType.Sto redProcedure
OConnection.ope n()
OCommand.Execut eNonQuery()
OConnection.clo se()

Produce the error
ERROR [42601] [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token
"END-OF-STATEMENT" was found following "InsertAreturn1 0". 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.Odb c.OdbcException : ERROR [42601] [IBM][CLI
Driver][DB2/NT] SQL0104N An unexpected token "END-OF-STATEMENT" was found
following "InsertAreturn1 0". Expected tokens may include: "JOIN
<joined_table>" . SQLSTATE=42601
Where as the following code (OleDB driver) run fine

Dim constr as String ="Provider=IBMD ADB2.1;Password =office;Persist Security
Info=True;User ID=db2admin;Dat a Source=UPLUS"
Dim OConnection as New System.Data.Ole Db.OleDbConnect ion(constr)
Dim OCommand As New System.Data.Ole DB.OleDbCommand ("InsertAreturn 10",
OConnection)
OCommand.Comman dType = CommandType.Sto redProcedure
OConnection.ope n()
OCommand.Execut eNonQuery()
OConnection.clo se()
Nov 12 '05 #1
1 5332
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_teitelba um@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
5203
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
3574
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 works fine except that rows are committed on a row by row basis thus performance is slow. I want to use the odbc driver but when I define it as the...
0
520
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 Procedure. Here is the VB .NET Code Dim constr as String = "DSN=UPLUS;UID=db2admin;PWD=office;MODE=SHARE;DBALIAS=UPLUS;PATCH2=6;PATCH1=...
3
10764
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 Microsoft.Data.Odbc.OdbcConnection("dsn=POLite;Trusted_Connection=yes;User Id=SYSTEM;Password=MANAGER")
2
1562
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 error wen i try and run it: ERROR Data source name not found and no default driver specified Description: An unhandled exception occurred...
5
3892
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. ERROR Driver's SQLSetConnectAttr failed ERROR Could not use '(unknown)'; file already in use.
0
12025
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 '/CinemaBookingSystem' Application. -------------------------------------------------------------------------------- ERROR General error Unable to open registry...
2
9377
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 have installed IIS as my server. I have installed Mysql 5.0 and mysql ODBC driver 3.51.12 in their default locations. Database is up and running...
3
2561
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 both of the following drivers, as well. Oracle ODBC Driver (version 8.01.05.00) Microsoft ODBC for Oracle Basically, I end up with the same generic...
0
3931
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 Oracle};Server=myserver;Uid=system;Pwd=mypwd;";
0
7886
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7920
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8183
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5685
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3809
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2312
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 we have to send another system
1
1413
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.