Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    11

    Unanswered: SQL Query syntax error

    I have a SQL statement that always stops with a SYNTAX error.
    sql = sql & "(PBID IDENTITY, "
    sql = sql & "CustID Char(20) NOT NULL, "
    sql = sql & "CustContact Char(30), "
    sql = sql & "CustPhone Char(20), "
    sql = sql & "CustExt Char(6), "
    sql = sql & "CustFax Char(20), "
    sql = sql & "CustEMail Char(30), "
    sql = sql & "PITAFact Char(2), "
    sql = sql & "ReceivedBy Char(2), "
    sql = sql & "URL Char(50), "
    sql = sql & "UserName Char(20), "
    sql = sql & "Password Char(20), "
    sql = sql & "ShipAdd1 Char(50), "
    sql = sql & "ShipAdd2 Char(50), "
    sql = sql & "ShipAddCity Char(30), "
    sql = sql & "ShipAddState Char(2), "
    sql = sql & "ShipAddZip Char(14)) "
    Set rs = Conn.Execute(sql)

    It always error out on line 12 with the Column Name Password

    If I delete the Column - No Error
    If I change the name to Password2 - No Error

    Is Password a reserved name in Pervasive V10?
    Thanks,
    Paul

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    well, i don't know pervasive at all, but i'll bet the answer is yes

    with the testing you've done, why do you still have doubts?

    and why can't you name the column pswd or something?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Yes, Password is a reserved word. You can either rename the column or enclose it in double quotes:
    CREATE TABLE pwdTest ("Password" char(20))
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  4. #4
    Join Date
    Jun 2006
    Posts
    11
    Thanks, my copy of the Pervasive documentation did not include PASSWORD in the reseved word list. It was allowed in V8.7. My procedure for creating the table stopped working when we upgraded to V10.

    Thanks again,
    Paul

Posting Permissions

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