473,387 Members | 1,516 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.

Error when writing to DB2 from SQL DB via VB.net

33
Complete newbie here so bear with me. I'm look at code written by a.n.other employee who is no longer around.

Using VB.net 2012, within one solution we have a routine which can successfully read data from a file on ISeries and populate a table in a sql db.
When we attempt to write to a file on the ISeries we receive the error "ERROR [42000][IBM][Iseries Access ODBC Driver][DB2 UDB]SQL0104 - Token DEFAULT was not valid. Valid tokens::<INTEGER>.

We can delete data from that same file however unable to write to the file. Permissions all look ok and we are using the same ODBCServerConnectionString.

Do you know if there is anything specific required for Update which is not required for Deletion or Read? Many tks.
Aug 23 '13 #1

✓ answered by LaRedSox

Quizzed - I have had the same problem recently. I think the problem is that the standard Microsoft ODBC classes don't generate the Update commands correctly. The solution was to use the IBM DB2 UDB classes that ship with the Client Access drivers.
1. During the CA install, ensure that the .NET Data Provider component is ticked
2. Add a Reference to this component within in Visual Studio
[NB. If it doesn't appear in the list of available .NET components, you can reference the .DLL directly from the CA install folder, called IBM.Data.DB2.iSeries.dll]
3. The classes use the same structure / naming convention as the equivalent Microsoft ODBC classes, with iDB2 prefices instead of ODBC e.g. iDB2DataAdapter, iDB2Command, iDB2Connection
4. Functionally these appear to work the same as the MS classes although there are some differences with the structure of the Connection String for instance.
5. For more details you could check out the IBM RedBook on the subject at http://www.redbooks.ibm.com/redbooks/pdfs/sg246440.pdf
Once I implemented these classes, I was able to Update the DB2 tables successfully.
Hope this helps.
LaRedSox

1 2227
Quizzed - I have had the same problem recently. I think the problem is that the standard Microsoft ODBC classes don't generate the Update commands correctly. The solution was to use the IBM DB2 UDB classes that ship with the Client Access drivers.
1. During the CA install, ensure that the .NET Data Provider component is ticked
2. Add a Reference to this component within in Visual Studio
[NB. If it doesn't appear in the list of available .NET components, you can reference the .DLL directly from the CA install folder, called IBM.Data.DB2.iSeries.dll]
3. The classes use the same structure / naming convention as the equivalent Microsoft ODBC classes, with iDB2 prefices instead of ODBC e.g. iDB2DataAdapter, iDB2Command, iDB2Connection
4. Functionally these appear to work the same as the MS classes although there are some differences with the structure of the Connection String for instance.
5. For more details you could check out the IBM RedBook on the subject at http://www.redbooks.ibm.com/redbooks/pdfs/sg246440.pdf
Once I implemented these classes, I was able to Update the DB2 tables successfully.
Hope this helps.
LaRedSox
Sep 4 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Glenn M | last post by:
I have an asp drive web page that writes a row to a table on sql server 2000. The web site is set to use windows authenication and the sql server is set to use windows authentication. This...
1
by: Supra | last post by:
i got "system error" when saving to xml file. i am using checkbox1 control to xml. when user clicked checkbox and set to true and press btnOk to conform and save it to xml ...
3
by: Ciccio | last post by:
Hi, I'd like to get some advices about this error "500 EOF when chunk header expected" that is displayed when validating some pages with W3C validator. Thanks in advance Bye
9
by: Ron | last post by:
my application is throwing an exception error when closing if I run a procedure in the app. I can't even trap the error with try/catch ex As Exception. Is there a way to completely shut down the...
4
by: 101 | last post by:
I get a security error when trying to write out to an XMLSchema file "myDs.WriteXmlSchema(strXMLSchemaFile)". I am running XP SP2, No Domain, MS file and print sharing uninstalled. I was able to...
0
by: riggor | last post by:
I have been searching for answers to this question ... but all I have found is other people asking the same question..but I have not found an answer... I am trying to install Oracle 10g on...
1
by: artteam | last post by:
Hi All, I get an error when I try to delete a record from the datagridview, which says Concurrency violation:the DeleteCommand affected 0 of the expected 1 records . Could someone please...
5
by: Martin | last post by:
I get below error when trying to write unicode xml to a zipfile. zip.writestr('content.xml', content.toxml()) File "/usr/lib/python2.4/zipfile.py", line 460, in writestr zinfo.CRC =...
2
by: Stephen D Cook | last post by:
Dim objConn objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "DSN=DCTRepair" objConn.Open() Dim objRS objRS = Server.CreateObject("ADODB.Recordset")...
3
by: Pallav singh | last post by:
Hi All i am getting Error while writing following code for state design Pattern kindly let me know How to Correct this Error ?? Thanks Pallav Singh ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.