vb连access的问题,原代码是连sql的。帮忙指点一下!
下面这段代码本来是连sql的
这两天转到连access怎么改呢? 我的access这个数据库的文件存在c盘根目录下面 ssq.mdb
Private Sub Command2_Click()
Dim ZhwgCon As New ADODB.Connection
Dim ZhwgRS As New ADODB.Recordset
ZhwgCon.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ssq;Data Source=(local)"
ZhwgRS.CursorLocation = 3 '设置游标类型
ZhwgCon.Open
ZhwgRS.Open "update ssq set new=1 where new=0", ZhwgCon '选择打开的表,后面的 ,ZhwgCon 必须有
ZhwgCon.Close
Form1.Caption = "动态过滤系统 数据库复原已完成!"
End Sub
[解决办法]
传说有一个叫adodb的控件,找到它。然后按向导联接,就生成你需要的字串了,copy就行。很容易做到吧!!
[解决办法]
[解决办法]
打开ADODC1控件属性页选连接字符串,选生成,在提供者选项中
选MICROSOFT jet 4.0 OLE DB Provider,然后按要求连接数据库等。
在ADODC1控件属性页使用连接字符串空白文本窗口中就有一长串字符串,
注意该字符串可复制到程序代码用于编程。
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db2.mdb;Persist Security Info=False"
[解决办法]
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\ssq.mdb;Persist Security Info=False"
[解决办法]
[解决办法]
Standard Security
Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\mydatabase.accdb;Uid=Admin;Pwd=777;
With database password
This is the connection string to use when you have an Access 2007 database protected with a password using the "Set Database Password" function in Access.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=777;
你写的我不用测试,肯定不对。Persist Security Info=False 后面还接密码??
逻辑也不对啊