Remote access through ADODB (1 Viewer)

T

tduccuong

Guest
Hi everyone, I'm just a newbie in DB programming and I'm having a trouble:

I have a database located in my IIS server: "c:\inetpub\wwwroot\webapplication1\dbs1.mdb".

I'm also developing a VB6 app in another computer which will access to my IIS server to get data in my database. I'm using ADODB, but I don't know how to establish the connection as well as to get the data from the server (remote machine).

Can anyone in here help me by showing an example in VB6 code?
Thank you very much, any sugestion is welcome
Reply With Quote
 

GRW

Registered User.
Local time
Today, 19:18
Joined
Sep 4, 2001
Messages
19
Something on these lines....

dim rst as ADODB.recordset

set rst = new ADODB.recordset
rst.open "TableName", "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\inetpub\wwwroot\webapplication1\dbs1.mdb"

' normal looping etc. here or test the open by

debug.print rst.fields(0).value ' should print the 1st field from the table

rst.close
set rst = nothing

Make sure you've got the Microsoft ActiveX Data Objects library checked under references, think 2.1 is the latest version....

Theres other ways to do the same, by splitting the connection from the open, but this is the most straight forward.
 
T

tduccuong

Guest
This doesn't work GRW! Because I am on a client computer to connect to my server. The
path "c:\inetpub\wwwroot\webapplication1\dbs1.mdb" is an absolute path! What I'm searching for is how to establish a remote connection to my database in my server? How to do the same work as you did above, but for a remote database in a remote machine?

Thank you GRW.
 

Users who are viewing this thread

Top Bottom