CodeItBetter Programming Another VB Programming Blog

How to establish and ADO connection over the internet.

Posted on August 12, 2011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'Database - How to establish and ADO connection over the internet.
Dim rsGeneric As Recordset
Dim cnnGeneric As Connection
 
Set cnnGeneric = New Connection
 
cnnGeneric.Open "Provider=MS Remote;" _
                & "Remote Provider=MSDataShape;" _
                & "Remote Server=http://www.webTest.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. 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.
Filed under: Database Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.