Access Request virker, SQL Request virker ikke
Hej allesammen,Jeg har en del request som virker perfekt når jeg henter data fra en access database, men når jeg blander en sql database ind, virker det ikke. Er der nogen der ved hvorfor?
INDEX.ASP
---------
<%
Set Connect = Server.CreateObject("ADODB.Connection")
Set RecSet = Server.CreateObject("ADODB.Recordset")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("data.mdb")&";"
%>
<%If Request.QueryString("CountryId") = "" Then%>
<table border="0" cellspacing="5" cellpadding="2">
<tr>
<td width="240" height="65" class="Act" nowrap><div class="DBox1Act">1. Välj</div><div class="DBox1"><!-- #Include file="SelectCountry.asp" --></div></td>
<td width="240" height="65" class="Wai" nowrap></td>
<td width="240" height="65" class="Wai" nowrap></td>
<td width="240" height="65" class="Act" nowrap></td>
</tr>
</table>
<!-- VÄLJ FUNCTION -->
<%ElseIf Request.QueryString("CountryId") = CountryId and Request.QueryString("FunctionNr") = "" Then%>
<table border="0" cellspacing="5" cellpadding="2">
<tr>
<td width="240" height="65" class="Chk" nowrap><div class="DBox1Chk">1. Välj</div><div class="DBox1"><!-- #Include file="SelectCountry.asp" --></div></td>
<td width="240" height="65" class="Act" nowrap><div class="DBox2Act">1. Välj</div><div class="DBox2"><!-- #Include file="SelectFunction.asp" --></div></td>
<td width="240" height="65" class="Wai" nowrap></td>
<td width="240" height="65" class="Act" nowrap></td>
</tr>
</table>
<!-- FUNCTION 1, VÄLJ CLIENT -->
<%ElseIf Request.QueryString("CountryId") = CountryId and Request.QueryString("FunctionNr") = 1 Then%>
<table border="0" cellspacing="5" cellpadding="2">
<tr>
<td width="240" height="65" class="Chk" nowrap><div class="DBox1Chk">1. Välj</div><div class="DBox1"><!-- #Include file="SelectCountry.asp" --></div></td>
<td width="240" height="65" class="Chk" nowrap><div class="DBox2Chk">1. Välj</div><div class="DBox2"><!-- #Include file="SelectFunction.asp" --></div></td>
<td width="240" height="65" class="Act" nowrap><div class="DBox3Act">1. Välj</div><div class="DBox3"><!-- #Include file="SelectClient.asp" --></div></td>
<td width="240" height="65" class="Act" nowrap>Välj klient <%=(CreditorNo)%></td>
</tr>
</table>
******DET ER DEN REQUEST SOM STÅR HER SOM IKKE VIRKER******
<!-- FUNCTION 1 (ADRESS OKÄND) -->
<%ElseIf Request.QueryString("CountryId") = CountryId and Request.QueryString("FunctionNr") = 1 and Request.QueryString("CreditorNo") = 180 Then%>
<table border="0" cellspacing="5" cellpadding="2">
<tr>
<td width="240" height="65" class="Chk" nowrap><div class="DBox1Chk">1. Välj</div><div class="DBox1"><!-- #Include file="SelectCountry.asp" --></div></td>
<td width="240" height="65" class="Chk" nowrap><div class="DBox2Chk">1. Välj</div><div class="DBox2"><!-- #Include file="SelectFunction.asp" --></div></td>
<td width="240" height="65" class="Chk" nowrap><div class="DBox3Chk">1. Välj</div><div class="DBox3"><!-- #Include file="SelectClient.asp" --></div></td>
<td width="240" height="65" class="Act" nowrap></td>
</tr>
</table>
<table border="0" cellspacing="5" cellpadding="2">
<tr>
<td width="240" height="65" nowrap>ddddssdscssf</td>
</tr>
</table>
<%End if%>
******DET ER DENNE HER SOM SENDER TIL DEN SOM IKKE VIRKER******
SELECTCLIENT.ASP
----------------
<%
connStr = "Provider=sqloledb.1;Network Library=DBMSSOCN;Data Source=DE-PGM; Initial Catalog=DKprod;User ID=sa;Password=sp/2001/9"
set conn = Server.CreateObject("ADODB.Connection")
set rs = server.createobject("adodb.recordset")
conn.Open connStr
%>
<select name="DB3" style="width:150" onchange="linkselect (this.options[this.selectedIndex].value)">
<option>Välj Klient</option>
<%
sqlquery ="select distinct Name as Name, CreditorNo as CreditorNo from niCredit where CreditorNo between 130 and 190 order by Name asc;"
rs.Open sqlquery, conn
Do While Not Rs.EOF
Response.Write "<option value='index.asp?CountryId=1&FunctionNr=1&CreditorNo="& rs("CreditorNo") &"'>"& rs("CreditorNo")&"</option>"
Rs.MoveNext
Loop
%>
</select>
SELECTCOUNTRY (Denne virker)
-------------
<select name="DB1" style=width:"150" onchange="linkselect (this.options[this.selectedIndex].value)">
<option VALUE="">Land/databas</option>
<%SQL = "SELECT * FROM DBCountry"
Set RecSet = Connect.Execute(SQL)%>
<%Do While Not RecSet.EOF%>
<option VALUE="index.asp?CountryId=<%=RecSet("CountryId")%>"><%=RecSet("CountryId")%>, <%=RecSet("CountryName")%></option>
<%Recset.MoveNext
Loop%>
</select>
