ADO Connections over the Internet

I started investigating this as part of a project for a customer who wanted to collect/upload data from vendors to a central server. On the other side, the end users (distributors) are able to update the product database on their laptops using the same process.

This is actually very simple, once you dig out the right info.

To fully test this out you will need a server with IIS. This server must have a Data Source Name (DSN) pointing to a database, in my case SQL Server, but you could use Access or any other ODBC source. You can also try this out on your own machine, by installing Personal Web Server and creating a DSN to point to your database.

Here is a sample code:


Dim rsGeneric as Recordset 
Dim cnnGeneric as Connection 
'
set cnnGeneric = new Connection 
'
cnnGeneric.Open "Provider=MS Remote;" _ 
    & "Remote Provider=MSDataShape;" _ 
    & "Remote Server=http://www.eviciti.com;" _ 
    & "Data Source=Products;" _ 
    & "User Id=Distributor;Password=trythis1;" 
'
set rsGeneric = new Recordset 
'
With rsGeneric 
    .CursorLocation = adUseClient 
    .Open strQuery, cnnGeneric, adOpenStatic, adLockReadOnly 
    .ActiveConnection = nothing 
End With 
'

The crux of the connection lies in the connect string (duh!). You must
specify, the provider as "MS Remote" - notice the space in the keyword.
I then must provide the address to the "Remote Server". Note that I
could just as well have said "http://192.168.1.1";. "Data Source" is the
DSN you are trying to open on the server. User Id and Password are self
explanatory.

Notice that I am also using data shaping and disconnecting the read-only recordset from the database, a good thing to do when dealing with remote databases. In order to utilize data shaping you must specify MSDataShape as the "Remote Provider".

Final note: This code will not work as is. There is no DSN named Products at www.eviciti.com, no database. This is just a shamless plug... :)



Comments

  • Impartial blog shows you Five brand-new stuff for nike that absolutely no one is covering.

    Posted by BobHotgloff on 05/17/2013 10:54am

    A nice double twist on bikini [url=http://plus-size-swimwear.webnode.com/]plus size swimwear[/url] Extraordinary piece of writing delivers the leading points for swimwear that a few buyers know of. [url=http://modest-swimwear.webnode.com/]speedo swimwear[/url] Impartial post unveils A number of new stuff surrounding bikini that no-one is speaking about. [url=http://spanx-swimwear.webnode.com/]vintage swimwear[/url] Exactly why everybody is extremely wrong about swimwear and as a result reasons why you really should look at this story. [url=http://vitamin-a-swimwear.webnode.com/]swimwear for women[/url] As to the reasons all kinds of things you have found out about swimwear is truly wrong and what you should understand. Innovative new swimwear Book Shares Ideas On How To Rule The swimwear Scene [url=http://girls-swimwear.webnode.com/]womens swimwear[/url] Contemporary questions on swimwear replied to and why you must definitely start reading each phrase within this article. [url=http://freya-swimwear.webnode.com/]freya swimwear[/url] Those things everyone else engages in in regard to swimwear and moreover the actions you would want to do different. [url=http://victoria-secret-swimwear.webnode.com/]victoria secret swimwear[/url] Hot swimwear Publication Unwraps Methods To Dominate The swimwear World [url=http://cheap-swimwear.webnode.com/]cheap swimwear[/url] Brand-new site unveils the suggestions for swimwear and furthermore the reasons why you need to take action this afternoon.[url=http://women-swimwear.webnode.com/]tan through swimwear[/url] Exceptional guide provide you with the important points for swimwear that only a few visitors know.

    Reply
  • The Key In order to rule the mizuno-scene Is Fairly Simple and easy!

    Posted by Acuddence on 04/23/2013 12:05pm

    Brand new questions about nike replied and as a result the reasons why you ought to take a look at every statement of this specific guide.[url=http://www.nikejpgolf.biz/]nike ゴルフ[/url] A legitimate double strain on mizuno [url=http://www.nikejpgolf.biz/nike-ゴルフボール-c-23.html]ナイキ ボール[/url] Newbie questions regarding mizuno have been answered and why you ought to read through each term in this story. [url=http://www.nikejpgolf.biz/nike-アイアン-c-1.html]nike ゴルフ[/url] Neutral blog divulges A couple of fresh new stuff on nike that not a soul is talking about. [url=http://www.nikejpgolf.biz/nike-アイアン-c-1.html]ゴルフ ナイキ[/url] The main mizuno Business Meaning : People who cares about zilch revenues?!? [url=http://www.nikejpgolf.biz/nike-ゴルフシューズ-c-15.html]nike sb[/url] Materials and developing throughout Sin City - mizuno will leave with no thanks [url=http://www.nikeyasuyi.com/]ナイキスニーカー[/url] Tools and release in South america : nike has left without any kind regards [url=http://www.nikeyasuyi.com/nikeナイキRunning-c-3.html]nike ランニング[/url] I would say the nike Firm Meaning : Workers who cares about zero triumphs? [url=http://www.nikeyasuyi.com/nikeナイキDunk-c-9.html]nike dunk[/url] How the mizuno Enterprise Meet -- Individuals who really cares about virtually nothing profit?? [url=http://www.nikeyasuyi.com/nikeナイキDunk-c-9.html]nike シューズ[/url] mizuno will give new life span for an old subject-- gold standards

    Reply
  • Here Offer the cheap MBT sandals for women online with high-quality 9y

    Posted by Rxabuap30 on 03/23/2013 04:24pm

    [p]These types of Mulberry Glenohumeral joint Bags are usually built together with durable allover pebbled external along with vintage styles components . This should lead to continued yield expansion over more years and a progress from sub 10% margins to over 20% . The handbag is one of the most needed details which to the stylish MM are indispensable . Mulberry Handbags arrive in broad variety of methods [url=http://www.burberrycoatsales.com]burberry shoes[/url] for example purses, shoulder bag, wallets etc . The colors add more to the elegance and sophistication of the handbags . Replica Lancel bag sacks supplied within our store are developed using the most effective worth mulberry bags target components and conceived by achieved craftsmen are habitually the in simple fact belongs to worthy goods, as any Lancel followers on the marketplace mulberry outlet know . There are on the understanding that elbows among all recognised highly successful people who will turns into a property by [url=http://www.burberry520.com]burberry men[/url] it . It each complex and straightforward and it is the intertexture of classical and avant-garde.[/p][p]Mulberry hobo Handbags Sale [url=http://www.burberrycoatsales.com]burberry shirt[/url] Mulberry satchel Handbags Sale Mulberry messenger Handbags Sale . mulberry Touch for girls is absolutely a lemony conjugal flowers balm by utilizing boilerplate information, just so auspicious in admission to quite . Right now , their production lines mainly process there styles, namely Alexa隆炉s?Bayswater as well as newly Lily of year . Just pay a visit to our site and choose a bag you like . My mulberry pouches online warehouse which trade [url=http://www.lovelyburberry.com]burberry bags sale[/url] Mulberry pouches is now there has been some improvement . Mulberry bags are famed for its uniting design and sophistication, stand out of biggest detailing . The external Mulberry plaque witout a doubt told its distinctiveness and high quality [url=http://www.burberry520.com]burberry discount[/url] while external oversized Mulberry rivets reveal some toughness, creating a stronger plus more fabulous looking for this purse . You隆炉ll find numerous merchants of Mulberry pouches [url=http://www.lovelyburberry.com]burberry sale[/url] indoors your restricted market.[/p]

    Reply
  • jiHRd cBY XgZd

    Posted by yYueSYZnfB on 11/14/2012 01:49am

    carisoprodol 350 mg kind drug soma - medication soma carisoprodol

    Reply
  • SdzSR JPM tMKg

    Posted by ogkGfpLohA on 11/13/2012 08:58pm

    buy soma online carisoprodol 750 mg - soma drug dosage

    Reply
  • Great

    Posted by j11_ambriez on 07/16/2009 11:08pm

    Thanks for the help

    Reply
  • I CHALENGE YOU!!!

    Posted by Legacy on 01/29/2004 12:00am

    Originally posted by: Dr. VB

    IF DOES CODE ARE WORKING GIVE ME A SAMPLE PROJECT TO PROVE IT. IF IT WORKS I LL GIVE YOU PROJECTS IN A RIGHT PRICE. ONLY IF YOU ARE INTERESTED.

    Reply
  • Error

    Posted by Legacy on 07/07/2003 12:00am

    Originally posted by: Matthew

    When i run this , it gives me an error that the object/module was not found.
    
    


    Dim rsGeneric As Recordset
    Dim cnnGeneric As Connection
    Dim strquery As String
    strquery = "select * from Notebook_Specs where SeriesNum='1950'"
    '
    Set cnnGeneric = New Connection
    '
    cnnGeneric.Open "Provider=MS Remote;" _
    & "Remote Provider=MSDataShape;" _
    & "Remote Server=http://www.heptagon.ca;" _
    & "Data Source=webdata_heptagon_ca;" _
    & "User Id=;Password=;"
    '
    Set rsGeneric = New Recordset
    '
    With rsGeneric
    .CursorLocation = adUseClient
    .Open strquery, cnnGeneric, adOpenStatic, adLockReadOnly
    .ActiveConnection = Nothing
    End With
    '


    With rsGeneric
    Text1.Text = !Price
    End With

    Reply
  • Online Data Updation

    Posted by Legacy on 01/02/2003 12:00am

    Originally posted by: Biju

    We are planning to develope a vb program for a firm which have a central office and 4 work sites. We have to update the central database throuch internet. The database is Oracle 9i.

    How can we update the database which is located at central office from the worksite through internet?

    Which of the following internet connectivity can be used for the updation:

    64/128 Kbps Leased Line
    64/128 Kbps ISDN
    Ordinary DialUp.

    The amount of data is not too big.

    Reply
  • Same Internet Server Error: no Ms Access Dsn connectivity

    Posted by Legacy on 07/19/2002 12:00am

    Originally posted by: Somdutt

    I am able to connect to ms sql server....but not with ms Access 2000 DSN....i don't know why?..i keeps on giving the error internet sever error...i don't know about it..it's not able to open the records i guess!!!

    Dim rsGeneric As Recordset
    Dim cnnGeneric As Connection
    Set cnnGeneric = New Connection
    '
    cnnGeneric.Open "Provider=MS Remote;" _
    & "Remote Provider=Microsoft.Jet.OLEDB.4.0;" _
    & "Remote Server=http://www.alkatravel.com;" _
    & "Data Source=success;" _
    & "User Id=alka;Password=yagnik;"
    '
    Set rsGeneric = New Recordset
    strQuery = "select * from security"
    With rsGeneric
    .CursorLocation = adUseClient
    .Open strQuery, cnnGeneric, , , adCmdText
    .ActiveConnection = Nothing

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • QA teams don't have time to test everything yet they can't afford to ship buggy code. Learn how Coverity can help organizations shrink their testing cycles and reduce regression risk by focusing their manual and automated testing based on the impact of change.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds