>I can easily add FOXPRO 3.0 databases to my forms, but how can I do it without binding objects to the fields. In otherwords, how do I create the connectivity through code only??
>
>RDO, DAO, ODBC, JET?? How?? HELP!!!
>
>Keith
Hi Keith,
You can open a Foxpro database in Visual Basic by attaching the Foxpro table to a MS Access database or even directly.
To open a Microsoft FoxPro table directly, create a Database object and use the OpenDatabase method to indicate the path, exclusive access value, read-only value, and data source name.
The following example shows how to open an external FoxPro version 2.0 table and then create a Recordset object from the table.
Dim dbsJet As Database
Dim rstAccounts As Recordset
' Open external FoxPro database.
Set dbsJet = OpenDatabase _
("\\FOXPRO\DATA\AP", False, False, "FoxPro 2.0;")
' Create Recordset object from Accounts table.
Set rstAccounts = dbsCurrent.OpenRecordset("Accounts")
You can see VB help under the topic Accessing Data in a Microsoft FoxPro Database. This example also I have quoted from there only. Hope this solves your problem.
Manika
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