使用代码 ADODC控件 连接数据库
Public Sub adoconn(dbfile As String)
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "" & dbfile & ";Persist Security Info=False"
Form2.Adodc1.CommandType = adCmdText
Form2.Adodc1.RecordSource = "select * from save order by 起始时间"
End Sub
请问怎么修改代码 调用过程 call adoconn(1.mdb) 就能连接1.mdb数据库
[解决办法]
这个特别适合你
[解决办法]
后面加一句Form2.Adodc1.refresh
[解决办法]
private Sub adoconn(dbfile As String)
with form2.Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "" & dbfile & ";Persist Security Info=False"
.CommandType = adCmdText
.RecordSource = "select * from save order by 起始时间"
.refresh
end with
End Sub