我正在尝试连接到我使用 godaddy 托管的访问数据库。我有 ASP 3.5、Php 5.2 和 IIS 7。我已经在我的 IIS 设置中为 vb 脚本设置了一个虚拟目录。我正在使用 Microsoft Visual Web Developer 2008。如果有人发现我与远程数据库的连接字符串有问题,可以告诉我吗?我真的需要为此使用 Access。谢谢
该代码类似于我遵循的教程。教程(它是西班牙语,但代码在本地而不是远程工作)
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Dim objConn As Object
Dim objRecords As Object
Dim strConn As String
Dim strQuery As String
objConn = Server.CreateObject("ADODB.Connection")
strConn = "Provider=MS Remote;" & "Remote Server=http://(IP Address here);" & "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("/logs/App_Data/users.mdb") & "Uid=admin" & "Pwd="
objConn.Open(strConn)
strQuery = "SELECT * FROM tbl_usuarios"
strQuery = strQuery + " Where str_usuario_ide='" + Login1.UserName + "'"
strQuery = strQuery + " And str_usuario_cve='" + Login1.Password + "'"
objRecords = objConn.Execute(strQuery)
If (Not objRecords.BOF) Then
e.Authenticated = True
Else
e.Authenticated = False
End If
objRecords.Close()
objConn.Close()
objRecords = Nothing
objConn = Nothing
End Sub
End Class