PDA

Click to See Complete Forum and Search --> : Convert to SQL


SAMS
Oct 24th, 1999, 07:09 PM
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).]

JHausmann
Oct 25th, 1999, 03:35 AM
What table does the field 'mk' belong to?

SAMS
Oct 25th, 1999, 08:17 AM
mk belong to 'export_claim' table.

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

Clunietp
Oct 25th, 1999, 10:14 AM
I don't believe you can update a joined query, you need to update the tables separately.

Tom

------------------
Clunietp@yahoo.com
[qualifications and/or certifications here]

JHausmann
Oct 26th, 1999, 03:38 AM
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):


dim sSQL as string

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

SAMS
Oct 26th, 1999, 11:30 AM
Thks, JHausmann and Clunietp. I will tried on that.