KAn man lägga en connection i en connection, typ som att ha en tabel i en tabel i HTML? hur skriver man i så fall. KAnske detta kan var till hjälp: Jag har lagt in koden, men jag vet inte om jag gjort rätt:Connection i en connection
Mvh Christofer
EX:
Connection 1
rs.open 1
Do while not rs.EOF
Connection 2
rs.open 2
rs.close 2
rs.Move next
Loop
rs.close 1Sv: Connection i en connection
<code>
Dim rs1
Dim rs2
Dim Conn1
Dim Conn2
Set Conn1 = Server.CreateObject("ADODB.Connection")
Conn1.Open ""
Set Conn2 = Server.CreateObject("ADODB.Connection")
Conn2.Open ""
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.Open "", Conn1
Set rs2 = Server.CreateObject("ADODB.Recordset")
Do Until rs1.EOF
rs2.Open "", Conn2
rs2.Close
Loop
Set rs2 = Nothing
rs1.Close
Set rs1 = Nothing
Con2.Close
Set Con2 = Nothing
Con1.Close
Set Con1 = Nothing
</code>Sv: Connection i en connection
:)
Här kommer min kod.
<code>
<%
distance = Request.Form("distance")
width = Request.Form("width")
ratio = distance/width
Response.Write(ratio)
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<table border="1">
<%
Dim rs1
Dim rs2
Dim Conn1
Dim Conn2
Set Conn1 = Server.CreateObject("ADODB.Connection")
Conn1.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/roos/test dv/test_db.mdb")
Set Conn2 = Server.CreateObject("ADODB.Connection")
Conn2.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/roos/test dv/test_db.mdb")
Set rs1 = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM prodTb WHERE '" & ratio & "' >= throw1 AND '" & ratio & "' <= throw2"
rs1.Open SQL, Conn1, 1, 2
pID = rs("prodID") !!!!!!kan man göra så här!!!!!!
Set rs2 = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM linsTb WHERE prodID = '" & pID & "' AND '" & ratio & "' >= ratio1 AND '" & ratio & "' <= ratio2"
Do Until rs1.EOF
rs2.Open SQL, Conn2, 1, 2
rs2.Close
Loop
Set rs2 = Nothing
rs1.Close
Set rs1 = Nothing
Con2.Close
Set Con2 = Nothing
Con1.Close
Set Con1 = Nothing
%>
!!!!!!Det här vill jag loopa!!!!!
<tr>
<td>
<%=rs("beskrivning")%><br><br>
<%=rs("linsbes")%>
</td>
</TR>
!!!!!!!!till hit !!!!!!!!
</table>
</BODY>
</HTML>
!!!!!!!var stänger jag min connections?!!!!!!!!
</code>