473,587 Members | 2,550 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("UniqueN umber") = "0001" 'Database is empty at this point,
"0001" for debug purposes.
rwUser("FirstNa me") = strFirstName
rwUser("LastNam e") = strLastName
rwUser("Login") = strLogin
'rwUser("Passwo rd") = "Hello" 'Update line ( below ) fails
'rwUser("Passwo rd") = strPassword 'Update line ( below ) fails
rwUser("PWord") = strPassword 'Does not fail
rwUser("PhoneNu mber") = strPhoneNumber
dtUser.Rows.Add (rwUser)

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

========
Oct 8 '06 #1
2 1583
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******@golde n.netwrote in message
news:e$******** ******@TK2MSFTN GP02.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("UniqueN umber") = "0001" 'Database is empty at this point,
"0001" for debug purposes.
rwUser("FirstNa me") = strFirstName
rwUser("LastNam e") = strLastName
rwUser("Login") = strLogin
'rwUser("Passwo rd") = "Hello" 'Update line ( below ) fails
'rwUser("Passwo rd") = strPassword 'Update line ( below ) fails
rwUser("PWord") = strPassword 'Does not fail
rwUser("PhoneNu mber") = strPhoneNumber
dtUser.Rows.Add (rwUser)

'Try
daDataAdapter.U pdate(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******@golde n.netwrote in message
news:e$******** ******@TK2MSFTN GP02.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("UniqueN umber") = "0001" 'Database is empty at this point,
"0001" for debug purposes.
rwUser("FirstNa me") = strFirstName
rwUser("LastNam e") = strLastName
rwUser("Login") = strLogin
'rwUser("Passwo rd") = "Hello" 'Update line ( below ) fails
'rwUser("Passwo rd") = strPassword 'Update line ( below ) fails
rwUser("PWord") = strPassword 'Does not fail
rwUser("PhoneNu mber") = strPhoneNumber
dtUser.Rows.Add (rwUser)

'Try
daDataAdapter.U pdate(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
2656
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 but double quoting the MODE, However when I try to do a select query it fails with error 936. We would like to keep this column name unchanged as...
2
12362
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 file I import. Unfortunately, I have no control over the column names and the data provider has chosen to use the word "USE" as a column name. "USE"...
2
1774
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 greeted with a 'Syntax error in Update statement.' when attempting the update. I take that field out and the update works. I am assuming Position is a...
1
1786
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 name. Any ideas? Thanks in advance, James Boulter
17
3809
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 using the dataAdapter.update sub, I get an error. The problem seems to be that one of the fields was named 'desc' which is a reserved word for...
1
1746
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 sql server at a time of inserting data into the table it is working properly. But when i try to insert data through sqldataadapter in C#, it is
31
3233
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 definition but class followed by equals is a simple assignment?
3
6043
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 used the field in a calculated control, i.e... =Trim() ... the control would display the name of the form. Error in help documentation?
4
12426
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 this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
0
7920
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...
0
7849
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7973
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
5394
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
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...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
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
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
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.