Print Page | Close Window

How to add to 2 Databases?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2677
Printed Date: 29 March 2026 at 7:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: How to add to 2 Databases?
Posted By: faubo
Subject: How to add to 2 Databases?
Date Posted: 13 May 2003 at 4:07pm

Hello,

Finally I got some time to get back to asp.

Ok, what I want to do is:

I have a form and I will add the information put on it in a Access DB,

then, in the same asp page,

I will add the same information PLUS the autonumber generated by the first DB in a second Access DB (this one in just a number field, not automatic)

How is the bast way to get this number generated in the first DB?

Thanks!

 



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here



Replies:
Posted By: michael
Date Posted: 13 May 2003 at 4:24pm

You can use seomthing like:
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open "tUsers", "AutoExample", adOpenKeySet, adLockPessimistic, adCmdTable
Rs.AddNew
Rs("UserName") = Request.Form("USERNAME")
Rs("UserEmail") = Request.Form("USEREMAIL")
Rs.Update
lUserID = Rs("UserID")                           'This is the Autonumber that you just inserted. 
Rs.Close Set
Rs = Nothing



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: faubo
Date Posted: 14 May 2003 at 12:55pm

Thanks Michael!

It worked.

Now... another question:

I have two Access databases with the exact the same structure (each one 15mb, I split because of server usage).

Is there a way to make a search in both of them, returning the results as if was just one DB (in this case I don't care about the usage)?



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net