'Connect to Access database remotely
I am trying to connect to my access databse that I have hosted with godaddy. I have ASP 3.5, Php 5.2, and IIS 7. I have gone and set up a virtual directory in my IIS settings for the vb script. I am using Microsoft Visual Web Developer 2008. Could anyone please let me know if they see something wrong with my connection string to the remote database? I really need to use Access for this. Thanks
The code is similar to a tutorial I followed. Tutorial (it is in Spanish but code works locally not remotely)
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|