Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Posts
    2

    Thumbs down Unanswered: Syntax error Insert INTO

    qrybiology.Close;
    qryBiology.SQL.Clear;
    qrybiology.active:=false;
    qrybiology.SQL.add('INSERT INTO tblstudents(username,Password,sName,sSurname,Cellp hone,Grade)'+
    ' VALUES ('''+ edtnewusername.Text + ''','''+ edtnewpass.Text + ''','''+ edtname.Text + ''','''+ edtsurname.Text + ''','''+ edtcell.Text + ''','''+ edtgrade.Text + ''')');

    qrybiology.ExecSQL;
    qrybiology.active:=true;

    i receive a syntax error in the INSERT INTO statement... please advise...

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Hi,

    the code

    Code:
    qrybiology.SQL.add('INSERT INTO tblstudents(username,Password,sName,sSurname,Cellp hone,Grade)'+
    ' VALUES ('''+ edtnewusername.Text + ''','''+ edtnewpass.Text + ''','''+ edtname.Text + ''','''+ edtsurname.Text + ''','''+ edtcell.Text + ''','''+ edtgrade.Text + ''')');
    Are you sure about the "Cellp hone". This might be Cellphone?
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  3. #3
    Join Date
    Oct 2010
    Posts
    1

    Talking Field Name

    Yeah, "Cellp hone" is the only case I got as a problem.
    MySql allows spaces in field names.But I hope you had not do so.
    So it may be a printing mistake.
    Good Luck!

Posting Permissions

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