- Tham gia
- 30/5/06
- Bài viết
- 1,630
- Được thích
- 17,442
- Nghề nghiệp
- Bác sĩ
Hai 2 Hai
Đối với ADO thì sau khi tạo connection, ta làm việc trên Connection đó với các đối tượng OLE DB Recordset như bình thường, có gì khác biệt hả anh? ADO thao tác với file text còn được mà, anh cứ coi dbf files là text file đi . Làm việc với database nói chung quanh quẩn chỉ là CRUD thôi mà (Create, Retrieve, Update, Delete).
P/S: Đừng dùng Bound control trong VB để làm việc với Database nhé, nó ko chuyên nghiệp tý nào đâu
ODBC Driver For Visual FoxPro
With a database container:
oConn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBC;" & _
"SourceDB=c : \somepath\mySourceDb.dbc;" & _
"Exclusive=No;"
Without a database container (Free Table Directory):
oConn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDB=c : \somepath\mySourceDbFolder;" & _
"Exclusive=No;"
For more information, see: Visual FoxPro ODBC Driver and Q165492
OLE DB Data Link Connections
Data Link File (UDL)
For Absolute Path:
oConn.Open "File Name=c: \ somepath\myDatabaseName.udl;"
For Relative Path:
oConn.Open "File Name=myDatabaseName.udl;"
For more information, see: HOWTO: Use Data Link Files With ADO
Note: Windows 2000 no longer contains the "New | Microsoft Data Link"
menu anymore. You can add the Data Link menu back in the menu list
by running the "C: \ Program Files\Common Files\System\Ole DB\newudl.reg"
reg file, Then right-click on the desktop and Select "New | Microsoft Data
Link " menu."
Or you can also create a Data Link file by creating a text file and change
It 's file extension To ".udl", Then double-click the file.
OLE DB Provider For Visual FoxPro
oConn.Open "Provider=vfpoledb;" & _
"Data Source=.\MyDB.dbc;"
For more information, see: Microsoft OLE DB Provider for Visual FoxPro