473,402 Members | 2,055 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,402 software developers and data experts.

VB2005 modifing Access 2003 with Update command error

1
The code below works fine to update my database by adding rows of data to my dataTable.

However when I use the same commands (changing the names of database, datatable and rows) with another database, I get an error on the following:
dataAdapter.Update(myDataTable)
that says "Syntax error in INSERT INTO statement."

I looked at all the field settings and the database properties I could find...
I even re-created the database from scratch to no avail.

The only thing I know is that the working database is a couple of years old...

thanks
Actual VB 2005 code below:

Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MAGACITIES.MDB"

Dim SQLstring As String
SQLstring = "SELECT * FROM Cities"

Dim dataAdapter As New OleDb.OleDbDataAdapter(SQLstring, connectionString)

Dim commandbuilder As New OleDb.OleDbCommandBuilder(dataAdapter)

myDataTable.Rows.Add()

myDataTable.Rows(myDataTable.Rows.Count - 1)("city") = TextBox1.Text
myDataTable.Rows(myDataTable.Rows.Count - 1)("country") = TextBox2.Text
myDataTable.Rows(myDataTable.Rows.Count - 1)("pop2005") = TextBox3.Text
myDataTable.Rows(myDataTable.Rows.Count - 1)("pop2015") = TextBox4.Text

dataAdapter.Update(myDataTable)

dataAdapter.Dispose()
Mar 12 '07 #1
1 1617
MMcCarthy
14,534 Expert Mod 8TB
I'm moving this question to the Visual Basic forum where I think it will get better attention.

ADMIN
Mar 13 '07 #2

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

Similar topics

6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
0
by: Henrik | last post by:
Hi There,,, I've createt a com-class in vb2005, but when i try to registrer it on a windows 2003 server, with framework 2.0, by using the command regsvcs.exe. Then i get the follewing error?? ...
0
by: gm | last post by:
Immediately after generating the Access application from the Source Safe project I get: "-2147467259 Could not use ''; file already in use." If Access database closed and then reopened I get:...
7
by: Rich | last post by:
Hello, I have an SP that inserts data into a sqlserver table. If a condition is not met within the SP after the data has been inserted into the table, the SP will rollback the insert. If I...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, Does vb2005 have a built-in UnDo feature / object for applications so that I can undo actions like other windows apps? Or do I have to write my own UnDo routine? If vb2005 does have a...
15
by: Aalaan | last post by:
I am presently a user of classic vb6 and hang out on those newsgroups. Some of you may be aware that there is a very anti MS and vb2005 feeling there. I have tried to get them to tell me which...
2
by: curran.george | last post by:
'add one textbox to form1 with Control Source property = ID 'copy/paste the form_load code below: 'Then open the form and then attempt to sort the datasheet 'crashes 2003, error 3450 Access 2007 -...
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: 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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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,...

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.