Reserved Word - Exception ? mdb table.

  • Thread starter Thread starter Miro
  • Start date Start date
M

Miro

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"

========
 
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.
 
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!
*************************************************
 
Back
Top