please help this blonde new to asp

Results 1 to 8 of 8

Thread: please help this blonde new to asp

  1. #1
    Raquel Anne Guest

    Default please help this blonde new to asp

    i get an update error when I run this, please help?<BR>what do I need to do?<BR>here is my code:<BR><BR>set conn= Server.CreateObject("ADODB.Connection")<BR>connect String = "DSN=***;uid=;pwd="<BR>conn.Open connectstring<BR><BR>sqry2 = "UPDATE customers where logincc = &#039" & iln & "&#039, invoice = &#039" & iinvoice & "&#039 (timelogout, totaltime, totalcharge)VALUES (&#039" & mytime & "&#039, &#039" & itimer & "&#039, &#039" & total & "&#039)"<BR><BR>set RS = conn.Execute (sqry2)<BR><BR><BR>Thanks in advance for your help<BR>Raquel Anne<BR>

  2. #2
    Nathen Grass Guest

    Default RE: please help this blonde new to asp

    Your Update statement should be in the following format:<BR><BR>UPDATE table_name<BR>SET field1 = value1, field2 = value2<BR>WHERE field = value<BR><BR>Hope that helps you out some.

  3. #3
    Raquel Anne Guest

    Default I dont quite understand :(

    please elaborate?

  4. #4
    Raquel Anne Guest

    Default I dont quite understand :(

    please elaborate?


  5. #5
    Nathen Grass Guest

    Default RE: I dont quite understand :(

    okay, say that I have a database table called Books that contains books and their associated authors. If I wanted to update the author&#039s name for a particular book the SQL statement would be:<BR><BR>UPDATE Books<BR>SET au_First_Name = &#039Mark&#039, au_Last_Name = &#039Twain&#039<BR>WHERE Book_Title = &#039The Adventures of Tom Sawyer&#039<BR><BR>I hope that helps.

  6. #6
    Raquel Anne Guest

    Default ok...getting a lil closer

    ok...I understand that, but how would it look in my code?<BR>Please help with this?<BR>Raquel Anne

  7. #7
    Nathen Grass Guest

    Default RE: ok...getting a lil closer

    Try this:<BR><BR>sqry2 = "UPDATE customers"<BR>sqry2 = sqry2 & " SET timelogout=&#039" & mytime & "&#039,"<BR>sqry2 = sqry2 & " totaltime=&#039" & totaltime & "&#039,"<BR>sqry2 = sqry2 & " totalcharge=&#039" & totalcharge & "&#039"<BR>sqry2 = sqry2 & " WHERE logincc=&#039" & iln & "&#039"<BR>sqry2 = sqry2 & " AND invoice=&#039" & iinvoice & "&#039"<BR><BR>This is assuming that all the data types are some sort of string (all the values are surrounded by single quotes).

  8. #8
    Raquel Anne Guest

    Default Thanks!

    thank you, you are a sweety and I owe you <BR>Thank-You very much!<BR>Raquel Anne

Posting Permissions

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