Results 1 to 12 of 12

Thread: remote connection to access via ADO

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    remote connection to access via ADO

    I am trying to connect via ADO to an access database. The database however is on a web host's webserver. So I am not sure if this is possible.
    Able Consulting gave an example doing this via asp pages that return XML data that ADO can read as a recordset. I tried this and it worked running it on my IIS here. but when I uploaded the pages and the DB to the webhost and tried to connect in VB to the database to return a recordset it failed saying the connection was invalid.

    Anyone have any idea why this doesn't work on the webserver?

  2. #2
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    Please rate my post.

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Spetnik
    Are you just selecting data? Why not just use WinHTTP or the URLDownloadToFile API to download the mdb first?
    i would need to open recordsets and update them

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Shawn N
    I think this might help you.

    http://www.roksteady.net/database/remotedata.asp
    I have no control over the webhosts server... so i can't set up anything on their end

  5. #5

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Spetnik
    I don't think it is possible then, unless you were to ftp the filese back when you were done.
    I just tried doing it on my free brinkster account and it worked. So that means it is a server limitation on the side of my webhost i guess....

  6. #6

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Spetnik
    Really? What code did you use to do that?
    http://www.able-consulting.com/MDAC/...oUrlConnection

  7. #7

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    i figure if i could use this method.. i could build a VB app.. and for it to access the database, i could just pass SQL statements as querystrings to the asp page.. .and have it return the recordset i pass... it would be almost the same as using it local... but in my case it needs to be on the net because our users interface with the DB as well...

    I think I will end up having to build an ASP application.. i was hoping to avoid that because I can build a VB application much faster and make it better using controls etc...

  8. #8

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Spetnik
    Yeah, that's pretty cool. I don't know what kind of server limitation would prevent that from working. Is there ADO on the server?
    yes ado.. but it seems to fail when it tries to write the data back to the response object... so I think maybe they don't have XML installed???

  9. #9

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Spetnik
    that could be...
    oh well im going to do it local for now... and email the webhost asking them to make it work.. if they cant... at least i know i can move the site to a brinkster payed account and it will work.. its only like 3 bucks more a month

  10. #10
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    You can get SQL server service for an extra 5 bucks on Brinkster, something like that.
    Please rate my post.

  11. #11
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    That's an excellent link. I was blissfully unaware of connecting to an Access database on a remote server using this particular method. The whole while I've been giving the following method to just some users, knowing the whole while it wouldn't work.

    Perhaps you should try this too, but with your luck....

    VB Code:
    1. Dim cnn As ADODB.Connection
    2. Dim rs As ADODB.Recordset
    3.  
    4. Set cnn = New ADODB.Connection
    5. Set rs = New ADODB.Recordset
    6.  
    7. Debug.Print cnn.State
    8. cnn.Open "Provider=MS Remote;Remote Server=http://myServer;" _
    9.             & "Remote Provider=Microsoft.Jet.OLEDB.4.0;" _
    10.             & "Data Source=c:\inetpub\wwwroot\biblio.mdb;admin,"
    11. Debug.Print cnn.State
    12.  
    13. rs.Open "SELECT * From Authors", cnn, adOpenKeyset, adLockOptimistic
    14.  
    15. Debug.Print rs.RecordCount

    C:\inetpub\wwwroot\biblio.mdb is the path to the database on the remote server.

    But, if you could get them to create a DSN for you, your chances to make this code work might improve. Just replace the file path with the DSN name.

    Also, take a look at this link:

    this link


    IMEO, if you're going to pay Brinksters anyways, go for their SQL Server Option. Access is, put politely, stupid.

  12. #12
    New Member
    Join Date
    Apr 2008
    Posts
    15

    Re: remote connection to access via ADO

    Does anyone have an update for these links please:
    http://www.able-consulting.com/MDAC/...oUrlConnection
    http://www.roksteady.net/database/remotedata.asp

    I would like to do allmost the same thing and open a persistent HTTP connection with VB using WinHTTP

Posting Permissions

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



Click Here to Expand Forum to Full Width