Results 1 to 6 of 6

Thread: Convert to SQL

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Singapore
    Posts
    43

    Post

    Hi guys, is there a way to convert the below statement into a SQL update statement??
    As when i tried to lump the two of the same kind .
    The system give me this error message " Insufficient key information for updating or refreshing."

    (SQL for adodc1 : SELECT export_comp.*, FEE_SC.* FROM FEE_SC, export_comp WHERE export_comp.VEND_ID = FEE_SC.VENID and Export_comp.PROCCODE = FEE_SC.FEESC )

    With Adodc1

    .Recordset.MoveFirst
    While (Not .Recordset.EOF)
    .Recordset.UpdateBatch
    .Recordset!mk = Text2.Text + Val(Text1.Text) / 100
    .Recordset.Update
    .Recordset.MoveNext

    Wend
    End With

    Thks

    [This message has been edited by SAMS (edited 10-25-1999).]

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    What table does the field 'mk' belong to?

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Singapore
    Posts
    43

    Post

    mk belong to 'export_claim' table.

    [This message has been edited by SAMS (edited 10-25-1999).]

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    I don't believe you can update a joined query, you need to update the tables separately.

    Tom

    ------------------
    [email protected]
    [qualifications and/or certifications here]

  5. #5
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    give the following code a shot (you're gonna have to work with it on the where conditions to make sure it updates the right stuff):

    Code:
     
    dim sSQL    as string
    
    sSQL = "update export_claim set mk =" & 
    Text2.Text + Val(Text1.Text) / 100 &
    "WHERE selection criteria"
    database.execute sSQL

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Singapore
    Posts
    43

    Post

    Thks, JHausmann and Clunietp. I will tried on that.

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