2 connections/2 recordset vist som ét fælles ???
Medsendt et eksempel på, hvorledes et opslag i en AS400 database og et opslag i en Oracle database præsenteres side om side i en tabel.Så er spm:
Hvoledes får jeg vist følgende (istedet for begge tabeller)
(sakset fra Access hvori det btw virker!!)
(shark1 = Oracle o movex1 = AS400)
SELECT DISTINCTROW shark1.ARTICLE_ID AS ArticleNo, shark1.SumOfQUANTITY AS [Shark Quantity], movex1.MLSTQT AS [Movex Quantity], [SumOfQUANTITY]-[MLSTQT] AS Difference
FROM shark1 INNER JOIN movex1 ON shark1.ARTICLE_ID = movex1.MLITNO
WHERE (((shark1.SumOfQUANTITY)<>[mlstqt]));
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
</HEAD>
<BODY bgcolor="#C0C0C0">
<table border="0" width="100%">
<tr>
<td width="46%" align="right"></td>
<td width="5%"></td>
<td width="49%"></td>
</tr>
<tr>
<td width="46%" valign="top" align="right">
<% Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DSN=movex;UID=XX;PWD=XX"
'"DRIVER={Client Access ODBC Driver (32-bit)}; SERVER=fhnt80;UID=XX;PWD=XX;"
MySQL="SELECT MITLOC50.MLITNO, MITLOC50.MLSTQT FROM MITLOC50 WHERE (((MITLOC50.MLWHLO)='003') AND ((MITLOC50.MLWHSL)='WAREHOUSE1'))"
Set MyRs=MyConn.Execute(MySQL)
%>
<table border=2 bgcolor="#808080" bordercolor="#FFFFFF">
<tr><% 'Put Headings On The Table of Field Names
howmanyfields=MyRs.fields.count -1
for i=0 to howmanyfields %>
<td bgcolor="#000080" bordercolor="#FFFFFF"><b><font color="#FFFFFF" face="Arial"><%=MyRs(i).name %></font></B></TD>
<% next %>
</tr>
<% ' Get all the records
do while not MyRs.eof %>
<tr>
<% for i = 0 to howmanyfields
ThisRecord = MyRs(I)
If IsNull(ThisRecord) Then
ThisRecord = " "
end if %>
<td valign=top bgcolor="#808080"><font face="Arial"><%=Thisrecord%></font></td><% next %>
</tr>
<%MyRs.movenext
loop%>
</table>
<%
MyRs.close
Set MyRs= Nothing
MyConn.Close
set MyConn=nothing
%>
</td>
<td width="5%" valign="top"></td>
<td width="49%" valign="top">
<% Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DRIVER={Microsoft ODBC for Oracle}; SERVER=fhnt80;UID=XX;PWD=XX;"
MySQL="SELECT LU.ARTICLE_ID, Sum(LU.QUANTITY) AS SumOfQUANTITY FROM LU GROUP BY LU.ARTICLE_ID"
Set MyRs=MyConn.Execute(MySQL)
%>
<table border=2 bgcolor="#808080" bordercolor="#FFFFFF">
<tr><% 'Put Headings On The Table of Field Names
howmanyfields=MyRs.fields.count -1
for i=0 to howmanyfields %>
<td bgcolor="#000080"><b><font color="#FFFFFF" face="Arial"><%=MyRs(i).name %></font></B></TD>
<% next %>
</tr>
<% ' Get all the records
do while not MyRs.eof %>
<tr>
<% for i = 0 to howmanyfields
ThisRecord = MyRs(I)
If IsNull(ThisRecord) Then
ThisRecord = " "
end if %>
<td valign=top><font face="Arial"><%=Thisrecord%></font></td><% next %>
</tr>
<%MyRs.movenext
loop%>
</table>
<%
MyRs.close
Set MyRs= Nothing
MyConn.Close
set MyConn=nothing
%>
</td>
</tr>
<tr>
<td width="46%" align="right"></td>
<td width="5%"></td>
<td width="49%"></td>
</tr>
</table>
</BODY>
</HTML>
På forhånd tak
Geert Larsen
