Home > How-To Library > Database
How to establish and ADO connection over the internet.
**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * **************************************************************** 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.
If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.