Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008

    Red face Unanswered: Connection to Remote Database

    I am trying to establish an ADODB Connection to a hosted web site database but am getting lost. The following code seems to work down to opening the SQL Select statement, where I get the message "Internet Server Error: Module/Object Not Found". (I assume that I should be using the address, or should this be the actual IP address for the hosted web site?)Hoping someone can please tell me how to resolve? Thanks

    Private Sub test2()
    Dim strConString As String
    Dim strsql As String
      strConString = "Provider=MS Remote;" & _
      "Remote Server=;" & _
      "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=e:\inetpub\111111\db\VacancyUpload.mdb;Persist Security Info=False"
      'initialize connection object variable
      Set adoConn = New ADODB.Connection
      'open connection
      adoConn.Open strConString, "admin", "password
      If adoConn.State = adStateOpen Then
        'no action
          MsgBox "Sorry. Connection to Web site not currently available."
       Exit Sub
       End If
      strsql = "Select * from TblWebUpload"      
    'initialize recordset object variable
      Set adoRst = New ADODB.Recordset
      with adoRst
      .Open strsql, adoConn   'ERROR 8209 OCCURS HERE
    Last edited by loquin; 09-18-08 at 16:20.

  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    You should have a web server set up at the remote end, and a DSN set up on the server, which points to the database in question...

    Then, your connection string will look something like this:

    strConString = "Provider=MS Remote;" _
        & "Remote Provider=MSDataShape;" _
        & "Remote Server=;" _
        & "Data Source=YOUR_DSN_NAME;" _
        & "User Id=A_USER_ID;Password=trythis1;"
    Note. If you will have multiple concurrent users connecting to the data, you may experience frequent data file corruption with Access. It's been documented that corruption is related to, among other factors, excessive delays or outright interruptions associated with updates. Since internet connections are inherently prone to delays, you might have issues.

    Ref ADO Connections over the Internet.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts