|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reserved Word - Exception ? mdb table.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. 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" > > ======== > 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. -- Show quoteHide quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA http://gregorybeamer.spaces.live.com/ ************************************************* Think Outside the Box! ************************************************* "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" > > ======== >
Experience Request: GPS Application
How to prevent Pasting into textbox? What is the optimal way to upload 10,000 records to Oracle DB? Multi-dimensional array - Question on Data types How do I replace unwanted characters from a string using Reg Exp? efficient routine to parse a text string Memory problem with vb.net + webServices + DLL Access DB on a pocket PC How can I get the data type of a data table's columns? uncleared code |
|||||||||||||||||||||||