Dim adoCon As New ADODB.Connection
Dim adoRs As New ADODB.Recordset
Private Sub Form_Load()
Dim sFilename As String
Dim sQuery As String
' dbf에 연결하기 위해 ConnectionString을 설정한다.
adoCon.ConnectionString = "Provider=MSDASQL.1;Extended Properties=DSN=Visual FoxPro Database;SourceDB=" & App.Path & ";SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=MACHINE;Null=Yes;"
adoCon.Open ' DB에 연결한다.
sFilename = "test.dbf" ' DB 파일명
sQuery = "select * from " & sFilename
adoRs.Open sQuery, adoCon, adOpenDynamic
MsgBox adoRs.Fields(0).Value
End Sub
Dim adoRs As New ADODB.Recordset
Private Sub Form_Load()
Dim sFilename As String
Dim sQuery As String
' dbf에 연결하기 위해 ConnectionString을 설정한다.
adoCon.ConnectionString = "Provider=MSDASQL.1;Extended Properties=DSN=Visual FoxPro Database;SourceDB=" & App.Path & ";SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=MACHINE;Null=Yes;"
adoCon.Open ' DB에 연결한다.
sFilename = "test.dbf" ' DB 파일명
sQuery = "select * from " & sFilename
adoRs.Open sQuery, adoCon, adOpenDynamic
MsgBox adoRs.Fields(0).Value
End Sub
댓글
댓글 쓰기