471,881 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 software developers and data experts.

Search two databases with ASP?

Hi,

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

Willem
Jul 22 '05 #1
6 1758
Willem wrote:
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Jul 22 '05 #2
Willem wrote:
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.
Jul 22 '05 #3
Gazing into my crystal ball I observed "Willem" <wv******@tiscali.nl>
writing in news:42*********************@dreader1.news.tiscali .nl:
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 & "'"

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #4
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

"Adrienne" <ar********@sbcglobal.net> schreef in bericht
news:Xn****************************@207.115.63.158 ...
Gazing into my crystal ball I observed "Willem" <wv******@tiscali.nl>
writing in news:42*********************@dreader1.news.tiscali .nl:
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 & "'"

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jul 22 '05 #5
<<
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...
*** Sent via Developersdex http://www.developersdex.com ***
Jul 22 '05 #6


Willem wrote:
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.

Jul 22 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by WindAndWaves | last post: by
83 posts views Thread by D. Dante Lorenso | last post: by
2 posts views Thread by Merrall, Graeme | last post: by
4 posts views Thread by neoform | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.