General information
Category:
ActiveX controls in VFP
>Does anyone have some examples of accessing VFP tables (free and in a DBC) via VB -- especially using ADO 2.0?
>
>I'd love to get a pointer toward some stuff to look at to bone up on this stuff.
>
>-- jas
Jeff,
Using the ADO Control is very easy all you need is a ODBC connection to the VFP DBC.
Here is a programmatic example:
Dim conn As New adodb.connection
Dim rs As New adodb.connection
Dim connectionstring As String
Dim SQLString As String
ConnectString = "DRIVER=Microsoft Visual FoxPro Driver;" & _
"UID=;SourceType=DBC;Exclusive=No;" & _
"BackgroundFetch=Yes;Collate=Machine;" & _
"SourceDB=c:\logbook\logbook.dbc """
SQLString = "Select * from Mission"
'Open connection
conn.Open (ConnectString)
' open recordset object
With rs
.CursorType = adOpenStatic
.Source = SQLString .ActiveConnectin = conn
.LockType = adLockBatchOptimistic
.Open
EndWith
Previous
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