473,511 Members | 16,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reserved Word - Exception ? mdb table.

I created a field in a db called "Password"

If i do that, the Update row command throws an exception error.
If I call the field PWord then it works great.

Is this a reserved word for an access db? or something?
Are there others?

Thanks,

Miro

====exception code
OleDbException was unhandled

Syntax error in INSERT INTO statement.

=====
=======code for updating db
rwUser = dtUser.NewRow()

Debug.WriteLine("whats the password =" + strPassword)

rwUser("UniqueNumber") = "0001" 'Database is empty at this point,
"0001" for debug purposes.
rwUser("FirstName") = strFirstName
rwUser("LastName") = strLastName
rwUser("Login") = strLogin
'rwUser("Password") = "Hello" 'Update line ( below ) fails
'rwUser("Password") = strPassword 'Update line ( below ) fails
rwUser("PWord") = strPassword 'Does not fail
rwUser("PhoneNumber") = strPhoneNumber
dtUser.Rows.Add(rwUser)

'Try
daDataAdapter.Update(rwUser) 'Will fail if the field is "Password"

========
Oct 8 '06 #1
2 1579
I don't believe it is, but if you are also using this word as a variable
name in your code, the compiler will get confused.
"Miro" <mi******@golden.netwrote in message
news:e$**************@TK2MSFTNGP02.phx.gbl...
>I created a field in a db called "Password"

If i do that, the Update row command throws an exception error.
If I call the field PWord then it works great.

Is this a reserved word for an access db? or something?
Are there others?

Thanks,

Miro

====exception code
OleDbException was unhandled

Syntax error in INSERT INTO statement.

=====
=======code for updating db
rwUser = dtUser.NewRow()

Debug.WriteLine("whats the password =" + strPassword)

rwUser("UniqueNumber") = "0001" 'Database is empty at this point,
"0001" for debug purposes.
rwUser("FirstName") = strFirstName
rwUser("LastName") = strLastName
rwUser("Login") = strLogin
'rwUser("Password") = "Hello" 'Update line ( below ) fails
'rwUser("Password") = strPassword 'Update line ( below ) fails
rwUser("PWord") = strPassword 'Does not fail
rwUser("PhoneNumber") = strPhoneNumber
dtUser.Rows.Add(rwUser)

'Try
daDataAdapter.Update(rwUser) 'Will fail if the field is "Password"

========

Oct 8 '06 #2
If you name a column or table using a keyword, surround with []. That is an
indicator to the database that you are using reserved words.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com/

*************************************************
Think Outside the Box!
*************************************************
"Miro" <mi******@golden.netwrote in message
news:e$**************@TK2MSFTNGP02.phx.gbl...
>I created a field in a db called "Password"

If i do that, the Update row command throws an exception error.
If I call the field PWord then it works great.

Is this a reserved word for an access db? or something?
Are there others?

Thanks,

Miro

====exception code
OleDbException was unhandled

Syntax error in INSERT INTO statement.

=====
=======code for updating db
rwUser = dtUser.NewRow()

Debug.WriteLine("whats the password =" + strPassword)

rwUser("UniqueNumber") = "0001" 'Database is empty at this point,
"0001" for debug purposes.
rwUser("FirstName") = strFirstName
rwUser("LastName") = strLastName
rwUser("Login") = strLogin
'rwUser("Password") = "Hello" 'Update line ( below ) fails
'rwUser("Password") = strPassword 'Update line ( below ) fails
rwUser("PWord") = strPassword 'Does not fail
rwUser("PhoneNumber") = strPhoneNumber
dtUser.Rows.Add(rwUser)

'Try
daDataAdapter.Update(rwUser) 'Will fail if the field is "Password"

========

Oct 8 '06 #3

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

Similar topics

0
2647
by: Tinku | last post by:
Hi All We are migrating one of our application from Informix to Oracle. Now one of our tables contains a column named "MODE" which is a reserved word. I could create the table with this name...
2
12349
by: Matthew Cascio | last post by:
My understanding is that using reserved words as column names is allowable as long as they are quoted. I am trying to create a table dynamically with columns defined by the first row of a text...
2
1762
by: Jessard | last post by:
Hi All, I am writing a .NET app that accesses an access View. The view has a table column called 'Position'. When i try and right an UpdateCommand string for this using this column I am...
1
1780
by: James Boulter | last post by:
Dear all, I have a database in which one column is titled 'force'. Now that this has become a reserved word, virtually no commands will execute, including of course a query to change the column...
17
3791
by: Benoit Martin | last post by:
I'm working on a project in VB.net connecting to a SQL Server 2000 database that I can't modify I created a dataset with a schema identical to the DB. When trying to update the DB from the dataset...
1
1744
by: archana | last post by:
Hi all I ma having problem in sqldataadapter. In my sql database i have one table containing column name as 'Name and address'. Here 'and' is reserved word which i am using in column name. In...
31
3210
by: metaperl | last post by:
-- python -i File "<stdin>", line 1 class = "algebra" ^ SyntaxError: invalid syntax Why isn' t the parser smart enough to see that class followed by an identifier is used for class...
3
6039
by: Robert | last post by:
I ask because, in Access help, it does not list is as such, however, I had a table with a field named 'Name'. If I put a control on a form and used this as the control source no problems, but if I...
4
12413
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
0
7353
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
7418
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...
1
7075
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
7508
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...
0
5662
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,...
1
5063
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
4737
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
3222
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...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.