Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL without MDB
Message
De
19/11/1998 06:31:27
Jody Cairns
OAO Technology Solutions
Moncton, Nouveau-Brunswick, Canada
 
 
À
19/11/1998 03:10:12
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Divers
Thread ID:
00159139
Message ID:
00159164
Vues:
29
>I am the beginner of VB6, at last I use VFP6 or Clipper for DOS now I want to try VB6 in my new application, but the problem is : Can VB6 create the temporary cursor by using SQL command without MDB ?, because I did not have any MDB files, I have DBF only .. how to do that .. ? give me the example

There's different ways to implement this type of thing. Here's a simple example:

Dim dbsFox As Database
Dim FoxDataRS As Recordset

' Our tables are located in the "d:\foxpro\rhds" directory
Set dbsFox = OpenDatabase("d:\foxpro\rhds", False, False, "FoxPro 2.6;")

' This is our SQL cursor
Set FoxDataRS = dbsFox.OpenRecordset("select name from river order by name")

' Data1 is a Data control on our form. This binds the cursor to the Data control
Set Data1.Recordset = FoxDataRS

If you have a textbox on your form called text1 then text1 will show the "name" field defined in our query with the following code when the user moves a record using the data control:

Private Sub Data1_Reposition()
Text1.Text = Data1.Recordset!Name
End Sub

You can also use ADO.

Also, check out

http://support.microsoft.com/support/kb/articles/q172/5/92.asp?FR=0

and

http://support.microsoft.com/support/kb/articles/q161/3/07.asp?FR=0

Hope that helps.

Best,

jody
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform