Results 1 to 6 of 6

Thread: Insert Error

  1. #1
    Join Date
    Feb 2003
    Posts
    107

    Unhappy Unanswered: Insert Error

    I getting the following error:

    [Microsoft][ODBC Microsoft Access Driver] The INSERT INTO statement contains the following unknown field name: ''UserName''. Make sure you have typed the name correctly, and try the operation again.

    when I try to run the following insert statment:

    INSERT INTO USERS ('UserName', 'UserFName', 'UserLName', 'Password', 'SecurityLevel') Values ('fun', 'ben', 'rover', '123456', '2')

    I am 100% sure the field exists. Does this have to do with the PK?
    The first field in the table is actually "USERID" and it is automatically incremented by Access.

    Please help!

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Insert Error

    Try changing the field name "USERNAME" to something else and then try..

    Originally posted by dotolee
    I getting the following error:

    [Microsoft][ODBC Microsoft Access Driver] The INSERT INTO statement contains the following unknown field name: ''UserName''. Make sure you have typed the name correctly, and try the operation again.

    when I try to run the following insert statment:

    INSERT INTO USERS ('UserName', 'UserFName', 'UserLName', 'Password', 'SecurityLevel') Values ('fun', 'ben', 'rover', '123456', '2')

    I am 100% sure the field exists. Does this have to do with the PK?
    The first field in the table is actually "USERID" and it is automatically incremented by Access.

    Please help!

  3. #3
    Join Date
    Feb 2003
    Posts
    107

    Re: Insert Error

    Oh. Then what?

    Originally posted by khan
    Try changing the field name "USERNAME" to something else and then try..

  4. #4
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Insert Error

    Replace the fieldname "UserName" with some other name every where. If you are successful in inserting the data, then it means that somehow the field name you were using was conflicting with MS Access reserved words.


    Originally posted by dotolee
    Oh. Then what?

  5. #5
    Join Date
    Feb 2003
    Posts
    107

    Re: Insert Error

    Hi there.

    I'm still getting the error. I changed the name of the "UserName" field to "FUserID" as a test.
    Here's the actual sql that's being generated.

    INSERT INTO USERS ('FUserID', 'UserFName', 'UserLName', 'Password', 'SecurityLevel') Values ('asdf', 'Julie', 'Lee', '123456', '2')

    ?err.Description
    [Microsoft][ODBC Microsoft Access Driver] The INSERT INTO statement contains the following unknown field name: ''FUserID''. Make sure you have typed the name correctly, and try the operation again.

    I tried changing the name of the table from Users to UserList but that doesn't make a difference. I know that I can read from the table because when the user logs in, I query this table for a matching user id. That logic has been working since day 1.
    ??
    Last edited by dotolee; 03-08-04 at 10:09.

  6. #6
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Insert Error

    This is the correct syntax
    INSERT INTO USERS (FUserID, UserFName, UserLName, Password, SecurityLevel) Values ('asdf', 'Julie', 'Lee', '123456', '2')

    Also make sure to include only text field values within quotes. All number field values should not be within quotes.


    Originally posted by dotolee
    Hi there.

    I'm still getting the error. I changed the name of the "UserName" field to "FUserID" as a test.
    Here's the actual sql that's being generated.

    INSERT INTO USERS ('FUserID', 'UserFName', 'UserLName', 'Password', 'SecurityLevel') Values ('asdf', 'Julie', 'Lee', '123456', '2')

    ?err.Description
    [Microsoft][ODBC Microsoft Access Driver] The INSERT INTO statement contains the following unknown field name: ''FUserID''. Make sure you have typed the name correctly, and try the operation again.

    I tried changing the name of the table from Users to UserList but that doesn't make a difference. I know that I can read from the table because when the user logs in, I query this table for a matching user id. That logic has been working since day 1.
    ??

Posting Permissions

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