Article ID: 172592
Article Last Modified on 7/2/2004
Option Explicit
Dim cn As New rdoConnection
Dim rs As rdoResultset
Dim SQL As String
Private Sub Command1_Click()
rs.edit
End Sub
Private Sub Command2_Click()
rs(1) = Text2.Text
rs.Update
End Sub
Private Sub Command3_Click()
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Unload Me
End Sub
Private Sub Command4_Click()
rs.MoveNext
If Not (rs.EOF) Then
Text1.Text = rs(0)
Text2.Text = rs(1)
Else
rs.MoveLast
End If
End Sub
Private Sub Command5_Click()
rs.MovePrevious
If Not (rs.BOF) Then
Text1.Text = rs(0)
Text2.Text = rs(1)
Else
rs.MoveFirst
End If
End Sub
Private Sub Form_Load()
'
' Using a DSN-less connection to open a free table
'
cn.Connect = "SourceType=DBF;" _
& "SourceDB=C:\Vfp\Samples\Data;" _
& "Driver={Microsoft Visual FoxPro Driver}"
cn.CursorDriver = rdUseOdbc
cn.EstablishConnection "rdDriverNoPrompt"
SQL = "select * from customer" 'this should be a free table
Set rs = cn.OpenResultset(SQL, rdOpenKeyset, rdConcurRowVer)
rs.MoveFirst
Text1.Text = rs(0)
Text2.Text = rs(1)
End Sub
161307 : How To Use Visual FoxPro Tables in Visual Basic 4.0
147875 : How To Use "DSN-Less" ODBC Connections with RDO and DAO
Additional query words: kbVBp500 kbVBp600 kbdse kbDSupport kbVBp kbVBp400 kbDAO kbVFP200
Keywords: kbhowto KB172592