"password" reserved keyword?

Results 1 to 2 of 2

Thread: "password" reserved keyword?

  1. #1
    Join Date
    Dec 1969

    Default "password" reserved keyword?

    I&#039;ve figured out the solution to a problem I was having, but I still don&#039;t understand the why of the problem.<BR><BR>In registering new users for a site, I collect userid and password on a form and write both variables to an Access 97 database table containing the fields "userid" and "password".<BR><BR>The ASP to do this reads:<BR><BR>strsql="insert into tbl_users (userid, password)" _<BR> & " values (&#039;" & userid & "&#039;, &#039;" & password & "&#039;)" <BR> con.execute strsql, con<BR><BR>When this is run, I get the following error:<BR><BR>HTTP 500.100 - Internal Server Error - ASP error<BR>Internet Information Services<BR><BR>Error Type:<BR>Microsoft JET Database Engine (0x80040E14)<BR>Syntax error in INSERT INTO statement.<BR>/sarg/gdc-register.asp, line 36<BR><BR>---Line 36 is the Con.execute strsql line---<BR><BR>If I change the database field for the password variable to "pass" and make the appropriate change in the strsql line, it works like a charm. All I can figure is that somewhere "password" is a reserved word. Is this correct? If not, what&#039;s the problem?

  2. #2
    Join Date
    Dec 1969

    Default Yes...but easy fix...

    put [...] around any field or table name that you even *think* might be a reserved word. Or just do it as a matter of course on all field/table names. Won&#039;t hurt, might help.<BR><BR>strsql="insert into [tbl_users] ([userid], [password])" _<BR> & " values (&#039;" & userid & "&#039;, &#039;" & password & "&#039;)" <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts