怎样写与ACCESS+VB的数据库连接
Public Sub exec(sql As String)
Dim con As ADODB.Connection
Dim constr As String
Set con = New Connection
constr = "Provider=Microsoft.Jet.OlEDB.4.0;Data Source=" + App.Path + "\Fpwd.mdb;Persist Security Info=False;Jet OLEDB:Database password=" & dbpwd
con.Open constr
set rs=con.Execute (sql)
End Sub
调用的时候只要写好sql语句就可以了
记得用完要关闭记录集哦@!~