If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > sql join with external file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-03, 19:09
ronhawker ronhawker is offline
Registered User
 
Join Date: Oct 2003
Posts: 2
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???

<%@LANGUAGE="VBSCRIPT"%>
<!--#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;"
%>
<HTML>
<HEAD>
<TITLE>Parts OBS Seach by Batch</TITLE>
</HEAD>
<BODY>
<%
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>"
objRSA.MoveNext
Wend

objRSA.Close
Set objRSA = Nothing
objRSL.Close
Set objRSL = Nothing
%>
</BODY>
</HTML>
Reply With Quote
  #2 (permalink)  
Old 10-05-03, 22:34
jlot6 jlot6 is offline
Registered User
 
Join Date: Sep 2003
Location: Newark, Vermont
Posts: 20
This might be a problem. I've never seen a connection string that looks like that? I could be wrong though.
Code:
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" -->
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On