Home All Groups Group Topic Archive Search About

Reserved Word - Exception ? mdb table.

Author
8 Oct 2006 4:45 PM
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"

========

Author
8 Oct 2006 5:11 PM
Scott M.
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.


Show quoteHide quote
"Miro" <miron***@golden.net> wrote in message
news:e$Q2Ikv6GHA.2380@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"
>
> ========
>
Author
8 Oct 2006 5:21 PM
Cowboy (Gregory A. Beamer)
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!
*************************************************
Show quoteHide quote
"Miro" <miron***@golden.net> wrote in message
news:e$Q2Ikv6GHA.2380@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"
>
> ========
>