我想通過公用對話框選擇訪問ACESS文件,用ADO連接!!
cdgOpendb.ShowOpen
strDataFile = cdgOpendb.FileName
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & strDataFile & ";Persist Security Info=False"
lbshowmsg.Caption = strConn
Adodc1.ConnectionString = strConn
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "ToolTip"
Text1.DataSource = "Adodc1"
Text1.DataField = "ToolTipID"TEXT1.DATASOURCE老是提示出錯?未找到方法!!
用絕對路徑連接就沒問題咯!!是怎麽回事咯??幫幫忙!!!
cdgOpendb.ShowOpen
strDataFile = cdgOpendb.FileName
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & strDataFile & ";Persist Security Info=False"
lbshowmsg.Caption = strConn
Adodc1.ConnectionString = strConn
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "ToolTip"
Text1.DataSource = "Adodc1"
Text1.DataField = "ToolTipID"TEXT1.DATASOURCE老是提示出錯?未找到方法!!
用絕對路徑連接就沒問題咯!!是怎麽回事咯??幫幫忙!!!
-----------------------------
缺少Set关键字
Set Text1.DataSource = "Adodc1"
strDataFile = cdgOpendb.FileName
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & strDataFile & ";Persist Security Info=False"
lbshowmsg.Caption = strConn
Adodc1.ConnectionString = strConn
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "ToolTip"Set Text1.DataSource = "Adodc1" '注意:你少了个Set :)
Text1.DataField = "ToolTipID"
能不能幫忙說明一下什麽情况下,哪些屬性一般用SET咯????