Search two databases with ASP?

Discussion in 'ASP General' started by Willem, Jun 28, 2005.

  1. Willem

    Willem Guest

    Hi,

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

    Willem
    Willem, Jun 28, 2005
    #1
    1. Advertising

  2. Willem

    Curt_C [MVP] Guest

    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
    Curt_C [MVP], Jun 28, 2005
    #2
    1. Advertising

  3. 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.
    Dave Anderson, Jun 28, 2005
    #3
  4. Willem

    Adrienne Guest

    Gazing into my crystal ball I observed "Willem" <>
    writing in news:42c19e7e$0$3904$:

    > 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
    Adrienne, Jun 28, 2005
    #4
  5. Willem

    Willem Guest

    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" <> schreef in bericht
    news:Xns9683981BF4D17arbpenyahoocom@207.115.63.158...
    > Gazing into my crystal ball I observed "Willem" <>
    > writing in news:42c19e7e$0$3904$:
    >
    >> 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
    Willem, Jun 29, 2005
    #5
  6. Willem

    Bullschmidt Guest

    <<
    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 ***
    Bullschmidt, Jun 30, 2005
    #6
  7. Willem

    Guest

    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 8, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken North
    Replies:
    0
    Views:
    584
    Ken North
    Jul 14, 2005
  2. Steve B.

    On DataTable, two databases

    Steve B., May 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    327
    sloan
    May 14, 2007
  3. Abby Lee
    Replies:
    5
    Views:
    375
    Abby Lee
    Aug 2, 2004
  4. Charlotte
    Replies:
    20
    Views:
    404
    Jeff Dillon
    Feb 12, 2008
  5. Alec Taylor
    Replies:
    2
    Views:
    89
    Alec Taylor
    Jul 19, 2013
Loading...

Share This Page