Click to See Complete Forum and Search --> : how to access database on a different server?
Hi There.
I'm using Access on my server and I want to make it that way that everyone that will register and his details will add to my database they will add to another databse of mine on a different server.
How can I connect between the two?
Thanks!
Exuro
12-13-2004, 09:54 PM
You'll need an ASP script on your other server that takes the form data, and it would probably be easiest to pass it through the query string. Submit the data to the script on your first server, and after altering the database redirect to your second server and edit that database, then redirect to another page (which you could pass in as a variable from the first server in the query string or something). I hope that makes sense!
I don't want the user to see what kind of details I'm gonna pass and more then that, I don't want the user to see the domain I'm sending it to.
Can it be "inside" the code?
russell
12-14-2004, 01:51 AM
don't do all that redirecting. just make multiple connection strings and do all the db writing on one asp script. for example
Dim db
Set db = Server.CreateObject("ADODB.Connection")
cn1 = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=\\server1\somepath\mydb.mdb;"
cn2 = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=\\server2\somepath\mydb.mdb;"
db.open cn1
'' execute some code against the 1st db
db.close
db.open cn2
'' execute some code against the 2nd db
db.close
set db = nothing
I have the other database on a different domin with a different hosting company... what then?
baconbutty
12-14-2004, 03:16 AM
You could try configuring the remote database to enable "remote access", and then specify the appropriate full path to it in the connection string.
baconbutty
12-14-2004, 03:54 AM
Hmm, not something I have done myself, I will confess, just an idea I had.
Looks like you may need to consider:-
1. Configuring your remote database to enable remote access. This will depend on your hosting provider and the type of database.
A quick google came up with this:-
http://support.microsoft.com/default.aspx/kb/253580?
2. Setting the "Dbq" to point to the remote path.
A quick google came up with this (a useful list of connection strings):-
http://www.able-consulting.com/ADO_Conn.htm
http://www.able-consulting.com/MDAC/ADO/Connection/MSRemote.htm
Sorry if this is not much help.