computerguy2
Programmer
- Jun 28, 2003
- 10
The following code returns -1 in the text box when I do a recordcound, and other errors when I try to update. I'm trying to connect a FoxPro table. Can someone tell me what I have done wrong, and how to correct the problem
Private Sub Command1_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
Set rs1 = New ADODB.Recordset
rs1.Open "select * from stock", conn, adOpenDynamic, adLockOptimistic
rs1.MoveFirst
Text1.Text = rs1.RecordCount
Text1.Text = rs1.Fields("BarcodeNo"
rs1.Fields("qoh" = 55
rs1.Update
End Sub
Private Sub Command1_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
Set rs1 = New ADODB.Recordset
rs1.Open "select * from stock", conn, adOpenDynamic, adLockOptimistic
rs1.MoveFirst
Text1.Text = rs1.RecordCount
Text1.Text = rs1.Fields("BarcodeNo"
rs1.Fields("qoh" = 55
rs1.Update
End Sub