# Re: 关于ADODC中资料库的相对路径问题~~~~!!!!

Posted by yeong huann on July 25, 1999 at 02:21:40:

In Reply to: 关于ADODC中资料库的相对路径问题~~~~!!!! posted by BEN on July 24, 1999 at 22:41:28:

不建议用控制项直接连上资料库,因为有太多状况不能掌握,你应用ADO来连结

Dim conn1 As New ADODB.Connection
Dim rs1 As New ADODB.Recordset

Dim Connstr1 As String
Dim DataAppfilename1 As String
DataAppfilename1 = "Data Source=" & App.Path & "\" & "ALLData.mdb"

Connstr1 = "Provider=Microsoft.Jet.OLEDB.3.51;" & DataAppfilename1
conn1.Open Connstr1

rs1.CursorLocation = adUseClient
rs1.Open "tb_Song", conn1, adOpenDynamic, adLockOptimistic

Follow Ups: