General information
Title:
VB 5.0 and the Visual FoxPro 5.0 ODBC driver
I have a problem with the above and need some help.
We have had to move some parts of our application to VB 5.0, because certain third party OCXs are not supported by VFP (namely: Distinct TCP/IP controls). With this in mind, we need to connect to a VFP 5.0 database and it's various tables from our VB 5.0 application.
The VB 5.0 application needs to be able to add/edit and delete records in the VFP tables.
Using VB & DAO, we have been able to connect to a VFP 5.0 database, and read in a list of all the tables contained there-in. How ever when we then create a record set from of those table it always appears to be read-only, and therefore we unable to achieve what we want. As shown below:
Private Sub Command1_Click()
Dim x As Integer
Set dbVFP = OpenDatabase("ODBC1", False, False, "DSN = ODBC1")
For x = 0 To dbVFP.TableDefs.Count - 1
List1.AddItem dbVFP.TableDefs(x).Name
Next
End Sub
Private Sub List1_DblClick()
Set rsVFP = dbVFP.OpenRecordset("SELECT cDescription FROM work", dbOpenDynaset, dbSeeChanges)
'List1.List (List1.ListIndex)
With rsVFP
.MoveFirst
.Edit
Debug.Print ![cdescription]
.Update
End With
At the .Edit line this fails.
Obviously I have checked the N/W file rights, ODBC set up, file in use, etc.
Any help would be appreciated.
James.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only