谢谢
恩,我也想知道这个问题.登陆窗口要连接Access数据库???虚心请教,管理能不能快点回答问题啊!
这可以连接上数据库但是就只能在开发机上运行
Private Sub login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim st As String
Dim filename As String = Application.ExecutablePath()
filename = filename.Substring(0, filename.LastIndexOf("\") + 1)
filename = filename & "chuzu.mdb"
st = " PageTimeout=5;FIL=MS Access;MaxBufferSize=2048;DSN=22;UID=admin;DBQ=" + filename + ";DriverId=25"
Try
cn1 = New OdbcConnection(st)
cn1.Open()
cnflag = True
' MsgBox("连接成功!!")
Catch ex As Exception
MsgBox("连接失败!!!!!!!!!!!!!")
End Try
End Sub
想请教各位大哥,我怎么修改上面的数据库连接,可以达到在任何的电脑上都可以打开数据库