Search two databases with ASP?

W

Willem

Hi,

I have a newbie question: is it possible to make a search form in asp that
searches in two different databases (access)?

Willem
 
C

Curt_C [MVP]

Willem said:
Hi,

I have a newbie question: is it possible to make a search form in asp that
searches in two different databases (access)?

Willem

Sure, just not with one call or one result set.
You'll have to do them individually then combine.
 
D

Dave Anderson

Willem said:
I have a newbie question: is it possible to make a search
form in asp that searches in two different databases (access)?

Of course. You simply perform two searches and aggregate the results.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
A

Adrienne

Hi,

I have a newbie question: is it possible to make a search form in asp
that searches in two different databases (access)?

Willem

Are you talking about two different databases, or two different tables?

If two databases, see prior responses.

If two tables, then you can do:

sql = "SELECT field FROM table1 WHERE field = '" & keyword & "'"
sql = sql & " UNION "
sql = sql & " SELECT field FROM table2 WHERE field = '" & keyword & "'"
 
W

Willem

Hi Adrienne,

Yes I'am talking about two (or more) whole databases (for combining two
tables I'd rather use a query).
I've read the two prior responses, but they're not very clear to me yet.

Regards,

Willem
 
B

Bullschmidt

<<
I have a newbie question: is it possible to make a search form in asp
that searches in two different databases (access)?
It's a little tricky but it can be done:

http://www.sitepoint.com/forums/showthread.php?t=101500
Forums » Program Your Site » ASP » Populate 1 Array with 2 Queries?

http://www.sitepoint.com/forums/showthread.php?t=178119
Forums » Program Your Site » ASP » linking 2 sep db's

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
 
L

larrybud2002

Willem said:
Hi,

I have a newbie question: is it possible to make a search form in asp that
searches in two different databases (access)?


If you want to use the sorting abilities in ADO, do a select in each
database, and insert the results into a disconnected recordset. Then
you could do a select on the disconnected recordset for sorting
purposes.

Or just stick the results of each database into an array and sort
manually.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,217
Latest member
IRMNikole

Latest Threads

Top