CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Guest

    Update Statement

    Hi, can anyone help me debug the following erroneous sql code for updating a particular record?

    sql = "Update Table1 Set Location = '" & Trim(Text1.Text) & "', " & _
    "Remarks = '" & Trim(Text2.Text) & "' " & _
    "Where " & _
    "Title = '" & Title & "' And " & _
    "Author = '" & Author & "'"

    Thanx.


  2. #2
    Join Date
    Jun 2000
    Location
    Jhb, Gauteng RSA
    Posts
    21

    Re: Update Statement

    I can't see anything Wrong, What error is SQL returning? what type of fields are location & remarks?



  3. #3
    Guest

    Re: Update Statement

    If you are executing this query in MS Access, you need to add a semi colon to the end of the sql. Update ... Where Title = 'Title here';


  4. #4
    Guest

    Re: Update Statement

    Hi,

    thanks for your responses. My sql statement is run from vb, and the entire error msg goes like this "Run time error '-2147217900(80040E14)': [Microsoft][ODBC Microsoft Access 97 Driver] Syntax error in Update statement". Location field is numeric (Long Integer) whereas Remarks field is a memo field.

    Thanx.


  5. #5
    Join Date
    May 1999
    Posts
    3,332

    Re: Update Statement

    since 'Location' is numeric, you shouldn't put single quotes around it.


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured