Connecting and pulling from 2 DSNs (AS400)

Results 1 to 3 of 3

Thread: Connecting and pulling from 2 DSNs (AS400)

  1. #1
    Matt Gabbard Guest

    Default Connecting and pulling from 2 DSNs (AS400)

    I am trying to pull data from two different libraries(databases) on the AS400. How do I create the connedtions? If I create two connection objects the SQL still only tries to pull from the first connection. Below is a sample of what I am trying:<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Set Conn2 = Server.CreateObject("ADODB.Connection")<BR>Set Rs = Server.CreateObject("ADODB.RecordSet")<BR>Conn.Ope n "DSN=AMFLIBB;UID=*****;PWD=*****" <BR>Conn2.Open "DSN=FILESB;UID=*****;PWD=*****" <BR><BR>ssql = "SELECT * FROM JOBSHP"<BR><BR>JOBSHP is in the FILESB DSN. The ODBC Error I get is:<BR>JOBSHP in AMFLIBB type *FILE not found <BR><BR>Can anyone tell me how to connect to both databases? I need info from both. Thanks!<BR><BR>Matt<BR><BR>

  2. #2
    Matt Gabbard Guest

    Default I figured it out.. Thanks. (NT)


  3. #3
    geeoff Guest

    Default RE: Connecting and pulling from 2 DSNs (AS400)

    Try this.....<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Op en "DSN=AMFLIBB;UID=*****;PWD=*****"<BR>Set rs = Conn.Execute(ssql)<BR>Conn.Close<BR><BR>Conn.Open "DSN=FILESB;UID=*****;PWD=*****"<BR>Set rs2 = Conn.Execute(ssql)<BR>Conn.Close<BR><BR>The problem may be with your DSN, have you verified that it is correct?<BR><BR>Hope this helps,<BR><BR>-geeoff<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts