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

OleDBDataAdpter update fails becorse of Fieldname in DB ??

The update seems to fail becorse of the fieldname in my DB

One of the fields is called "Zone" in my MDB

If i change the fieldname in both the database and in my test application,
the error is gone....

Any explanation ?

Nov 15 '05 #1
3 1564
It may be a reserved word. I assume you're using access. To get around this,
in your code, refer to the field as [Zone] instead of Zone. The brackets
indicate that you're referring to a field/table/view or other DB object and
not a reserved word.

Pete

--
http://www.petedavis.net
"Sagaert Johan" <RE*************@hotmail.com> wrote in message
news:%2********************@TK2MSFTNGP10.phx.gbl.. .
The update seems to fail becorse of the fieldname in my DB

One of the fields is called "Zone" in my MDB

If i change the fieldname in both the database and in my test application,
the error is gone....

Any explanation ?

Nov 15 '05 #2
This does'nt work , it tries to look for the field [Zone]

eg
oOrderRow["[Zone]"] = "bathroom"; does not work
"Pete Davis" <pd******@hotmail.com> wrote in message
news:ea******************************@news.meganet news.com...
It may be a reserved word. I assume you're using access. To get around this, in your code, refer to the field as [Zone] instead of Zone. The brackets
indicate that you're referring to a field/table/view or other DB object and not a reserved word.

Pete

--
http://www.petedavis.net
"Sagaert Johan" <RE*************@hotmail.com> wrote in message
news:%2********************@TK2MSFTNGP10.phx.gbl.. .
The update seems to fail becorse of the fieldname in my DB

One of the fields is called "Zone" in my MDB

If i change the fieldname in both the database and in my test application, the error is gone....

Any explanation ?


Nov 15 '05 #3
Sorry, my mistake. You don't want the brackets there. You'd want them in the
select statement around the field list (assuming you have a field list). But
in the datarow indexer, you'd simply use oOrderRow["Zone"] = "bathroom";

Pete

--
http://www.petedavis.net
"Sagaert Johan" <RE*************@hotmail.com> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl...
This does'nt work , it tries to look for the field [Zone]

eg
oOrderRow["[Zone]"] = "bathroom"; does not work
"Pete Davis" <pd******@hotmail.com> wrote in message
news:ea******************************@news.meganet news.com...
It may be a reserved word. I assume you're using access. To get around

this,
in your code, refer to the field as [Zone] instead of Zone. The brackets
indicate that you're referring to a field/table/view or other DB object

and
not a reserved word.

Pete

--
http://www.petedavis.net
"Sagaert Johan" <RE*************@hotmail.com> wrote in message
news:%2********************@TK2MSFTNGP10.phx.gbl.. .
The update seems to fail becorse of the fieldname in my DB

One of the fields is called "Zone" in my MDB

If i change the fieldname in both the database and in my test application, the error is gone....

Any explanation ?



Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Colin Steadman | last post by:
Part No Description Quantity 45643 Random part 10 45678 Another Random part 7 98944 And another 1 <submit button> ...
0
by: Fraser Hanson | last post by:
Hello, I have a table which has a foreign key relationship with itself. I want and expect my updates to cascade (deletes definitely cascade as expected) but instead I just get error 1217:...
1
by: Gent | last post by:
am using FOR UPDATE triggers to audit a table that has 67 fields. My problem is that this slows down the system significantly. I have narrowed down the problem to the size (Lines of code) that need...
1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
3
by: Mark | last post by:
Hi all, I am trying to add 4 fields to an existing table which will show record creation date and time and record update date and time. I have managed to do the creation date and time ok by adding...
10
by: Randy Harris | last post by:
I imported records into a table, later found out that many of them had trailing spaces in one of the fields. If I'd caught it sooner, I could have trimmed the spaces before the import. This...
4
by: marti | last post by:
I've run into three problems trying to solve this one issue. Using VS2005 B2 & sql server 2000, I create a sqldatasource and bind a gridview to it. Everything looks good. However, if there is an...
5
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I...
4
by: Sim Zacks | last post by:
I am in the process of converting an existing database to PostGreSQL and wrote a generic script to update all of the sequences as they default at 1. I thought it would be useful to other people who...
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: 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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.