请各位老师帮我看一下代码错在哪!
Public filename As String, cnstr As StringPublic str_username As String
Public str_userqxz As String
Public conn As New ADODB.Connection
Sub main()
filename = App.Path & "\test\test.mdb" '本句原代码是:filename = "d:\test\test.mdb"运行正常,将d盘修改为当前文件夹下就出问题了.
cnstr = "Provider =Microsoft.Jet.OLEDB.4.0;Data Source='" & filename & " ';Persist Security Info=False"
conn.open cnstr'问题出在这句,代码变淡黄色
frm_login.Show
End Sub
或者如何将以下代码中的d:\test\test.mdb改为当前文件(程序所的)夹下
Public filename As String, cnstr As String
Public str_username As String
Public str_userqxz As String
Public conn As New ADODB.Connection
Sub main()
filename = "d:\test\test.mdb"
cnstr = "Provider =Microsoft.Jet.OLEDB.4.0;Data Source='" & filename & " ';Persist Security Info=False"
conn.open cnstr
frm_login.Show
End Sub
[ 本帖最后由 曙光电子 于 2012-11-20 19:04 编辑 ]