View Full Version : connecting to a remote access database
Bluemonkey
12-14-2002, 11:12 AM
how can i get this bit of code to conect to a databse thats on another server
strconn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("users.mdb")
sqluser = "SELECT * FROM users WHERE Username = '" & request.Form("Username") & "'"
set rs = server.CreateObject("ADODB.Recordset")
rs.Open sqluser,strconn,2,2
thank you for your help
whammy
12-14-2002, 11:27 AM
Is the server on your LAN?
Bluemonkey
12-14-2002, 05:54 PM
nope its on the internet
whammy
12-15-2002, 04:59 AM
I don't personally know of any way to connect to an Access database on a remote server (and I am fairly sure it isn't possible - which is a great thing!!!)... if it was on a LAN, you could simply browse to the server through "My Network Places" and get the path to the database that way.
Why would you need to look at an Access database that was in a completely different location?
If it's the same company, or a client, etc. you could always have them send data to you on a regular basis... I have some clients export their data to me in whatever text format and import into access since it is not very much data.
scroots
12-15-2002, 09:38 AM
it might not work but, in asp you can put some code in a page and it will tell you the address of the page, run the page to find out the directory and then just put it in your code.
scroots
BigDaddy
12-16-2002, 06:53 AM
Server.MapPath("users.mdb")
The above code would mean that the database resides on the server, hence the "server."
If you want to hit a database on another machine, you'd have to be able to map a drive to that machine, etc. You can't get to it by just giving it the ip address and browsing to it.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.