Results 1 to 3 of 3

Thread: Updating a table !!!! Please help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Ireland
    Posts
    224

    Question

    Hi guys
    I have a database that I am trying to update but can't seem to find an example of how to do it. What I am trying to do is examine my table(called table 1), If a value in the first field(called field1) is equal to the variable that I pass it. Then I wan to update the table in Field3 and Field4.

    Could someone please help me with this. I've been getting a syntax error message and can't seem to overcome this problem.

    Thanks a lot for your help
    Here's the code that I have
    Code:
                            Set Conn1 = New ADODB.Connection
                                Conn1.ConnectionString = AccessConnect
                                Conn1.Open
    sql_ack_update = "UPDATE Table1 Where  Field1 = '" & VariableInserted & "' Set Field3 = '" & Var & "', Field4 = '" & VAR2 & "';"
                            Conn1.Execute sql_ack_update
                            Conn1.Close

  2. #2
    Lively Member dlm's Avatar
    Join Date
    Oct 2000
    Location
    Geraardsbergen(Belgium)
    Posts
    91
    Hi,

    I think you have to put your where-clausule after your set-clausule...

    "UPDATE Table1 Set Field3 = '" & Var & "', Field4 = '" & VAR2 & " Where Field1 = '" & VariableInserted & "';"


    If you can solve the problem, why worrying about it…
    If you can’t solve the problem, worrying won’t help…

    De la Motte Günther

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Ireland
    Posts
    224

    Wink Thanks a lot

    Cheers
    JK

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