Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Statement too long error while using update

Status
Not open for further replies.

computerguy2

Programmer
Jun 28, 2003
10
When I use the update command in the following code I get a Run Time Error......Statement too long. Could you tell me how to use the update command in this case. It's VB6 and Visual FoxPro 6. Thanks

Private Sub Command2_Click()
Set conn = New ADODB.Connection
Let conn.ConnectionString = "Driver={Microsoft Visual Foxpro Driver};UID=;SourceType=DBF;SourceDB=c:\inventory;Exclusive=No;BackgroundFetch=No;Collate=Machine;Null=Yes;Deleted=Yes;"
conn.Open

hasconnected = True

Set rs1 = New ADODB.Recordset
rs1.Open "select * from stock", conn, adOpenDynamic, adLockOptimistic

rs1.Requery
rs1.MoveFirst

Text1.Text = rs1("BarcodeNo")
Do While rs1.EOF = False
Text1.Text = rs1("qoh")
If Trim(rs1("Barcodeno")) = "5190600014" Then
MsgBox rs1("qoh")
rs1("qoh") = "55"
rs1.Update
End If

rs1.MoveNext
Loop

End Sub
 
try using rs1.edit before you assign the new value like this.....

If Trim(rs1("Barcodeno")) = "5190600014" Then
MsgBox rs1("qoh")
rs1.edit
rs1("qoh") = "55"
rs1.Update
End If
 
ADO recordsets don't have an Edit method...

Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top