>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=0and
http://support.microsoft.com/support/kb/articles/q161/3/07.asp?FR=0Hope that helps.
Best,
jody