Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: sql join with external file

    I am attempting to search a database by partnumber by using a join of a batch entered file of partnumbers. The test code is below. I am new to asp. I don't have any problem with the connection as I can see both the SQL in a recordset and the text file values with Dreamweaver recordsets. I don't have a problem if the join is two tables in a single connection. The problem seems to be how to connection and define two different connections. It seems to be the way I am setting up the connections either through a command or conneciton object or my approach. Help???

    <!--#include file="../Connections/arrowhead.asp" -->
    <!--#include file="../Connections/lsprint.asp" -->
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' DesigntimeType="ADO"
    ' HTTP="false"
    ' Catalog=""
    ' Schema=""
    'Dim MM_arrowhead_STRING
    'MM_arrowhead_STRING = "dsn=arrowhead;uid=xxx;pwd=xxx;"
    ' FileName="Connection_ado_conn_string.htm"
    ' Type="ADO"
    ' DesigntimeType="ADO"
    ' HTTP="true"
    ' Catalog=""
    ' Schema=""
    'Dim MM_lsprint_STRING
    'MM_lsprint_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\url/public;Extended Properties=Text;"
    <TITLE>Parts OBS Seach by Batch</TITLE>
    Dim objCommandA, objRSA
    Set objCommandA = Server.CreateObject("ADODB.Command")

    objCommandA.ActiveConnection = MM_arrowhead_STRING

    objCommandA.CommandText = "SELECT hawker.Summarytest.PartNumber,LSPRINT#TXT.PARTNUMB ER " & _
    "FROM LSPRINT#TXT INNER JOIN hawker.SummaryTest " & _
    "ON hawker.Summarytest.PartNumber = LSPRINT#TXT.PARTNUMBER"
    ' objCommandA.CommandType = adCmdText

    Set objRSA = objCommandA.Execute
    Set objCommandA = Nothing

    While Not objRSA.EOF
    Response.Write objRSA("PARTNUMBER") & "<BR>"

    Set objRSA = Nothing
    Set objRSL = Nothing

  2. #2
    Join Date
    Sep 2003
    Newark, Vermont
    This might be a problem. I've never seen a connection string that looks like that? I could be wrong though.
    MM_lsprint_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\url/public;Extended Properties=Text;"
    Also, a lot of your code is commented out and it would help to see the following files:
    <!--#include file="../Connections/arrowhead.asp" -->
    <!--#include file="../Connections/lsprint.asp" -->

Posting Permissions

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