>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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement