Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating two databases in two places

Status
Not open for further replies.

n0795

Programmer
Jul 30, 2001
136
US
I use this code to update a database with an email address,I would like to update a different database using the same form so the users do not have to do it twice.
The other database is on E but not in test its in the root of my site and its called users.mdb
Response.Buffer = true
dim cnn,rst
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")
cnn.Open "driver={Microsoft Access Driver (*.mdb)};;DBQ=E:/Test/testdatabase.mdb;"
sqltext = "SELECT * FROM Testdatabase"
rst.Open sqltext,cnn,3,3

dim Email
Email = Request.Form("Email")
if Email = "" then
error = "You have not entered an Email address.please click back"
Response.Write error
Response.End
end if

rst.AddNew
rst("Email") = Email
rst.update

%>
 
two different access databases takes two different connections. Just create another connection to the other DB, then issue the same SQL query.

Although -- you might want to look into linking tables... I don't have a lot of experience with it, but it might work in your situation.

hth
leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top