我試圖連接到我與godaddy託管的訪問數據庫。我有ASP 3.5,PHP 5.2和IIS 7.我已經離開並在我的IIS設置中爲vb腳本設置了一個虛擬目錄。我正在使用Microsoft Visual Web Developer 2008.任何人都可以讓我知道他們是否看到我的連接字符串與遠程數據庫有問題?我真的需要爲此使用Access。謝謝遠程連接到Access數據庫
該代碼與我所遵循的教程類似。 Tutorial(它是西班牙語,但代碼工作在本地沒有遠程)
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
PHP和ASP的混合?您確定Access已經在GoDaddy服務器上可用了嗎?另外,你爲什麼不把你的腳本放在GoDaddy上? – Raptor 2012-07-09 02:15:13
那麼服務器只是安裝了asp和php。我認爲這將有助於引用。該腳本託管在Godaddy的服務器上,當我嘗試連接到它時,它給我提供了'/ logs'Application.'信息中的服務器錯誤。 – 2012-07-09 02:20:36
我認爲你訂閱的是共享主機方案而不是4GH系列計劃,對不對?因爲4GH計劃沒有MS Access服務... – Raptor 2012-07-09 02:27:20