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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

splitting user form info to 2 different data bases. :-) 1

Status
Not open for further replies.

Yogi39

Technical User
Jun 20, 2001
273
CA
How can I split were part of the info from a user form is sent to data base "a" and the rest of the info from the user form is sent to data base "B"
Thanks for any help ! :)
 
set up two connections -- one to database a and one to database b.

Then, just read in your values, and assign away.

<%
dim con1, con2
dim sql1, sql2
dim val1, val2
set con1 = server.createobject(&quot;ADODB.Connection&quot;)
set con2 = server.createobject(&quot;ADODB.Connection&quot;)
con1.open &quot;dsn1Name&quot;
con2.open &quot;dsn2Name&quot;

val1 = request.form(&quot;val1&quot;)
val2 = request.form(&quot;val2&quot;)

sql1 = &quot;UPDATE table1 SET val1=&quot; & val1
sql2 = &quot;UPDATE table2 SET val2=&quot; & val2

con1.execute sql1
con2.execute sql2

set con1 = nothing
set con2 = nothing
%>

So that you opened two different connections to two different databases, got your separate values from the form object, and executed two separate update commands on the two respective databases.

hope that helps! :)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top