Hallo ich hoffe ich bin hier richtig.
Mein Problem ist dass ich keine records im rs angezeigt bekomme wenn ich die SQL abfrage mit einer Variable dynamisch gestalte. Aber auch keine Fehlermeldeung !
Wenn ich anstelle der Variable nach dem WHERE Statement den definitiven Strin setze zeigt er die gefilterten records im rs auch korrekt an nur mit der variable haut das nicht hin.
Testserver ist lokal iis 5.0 auf win 2000 alle wichtigen komponenten für asp sind up to date...
ich hoffe es kann mir jemand helfen.
vielen Dank schon mal im voraus.
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="../../Connections/AC2KDBCONN.asp" -->
<%
var ccsvar=Request.Form("CCSELDD") <-- hat den wert nach dem die DB gefiltert werden soll und wird auch korrekt im Body ausgegeben.
var RS2TEST = Server.CreateObject("ADODB.Recordset");
RS2TEST.ActiveConnection = "dsn=ACADEMY;";
RS2TEST.Source = "SELECT * FROM CC_SEL_TBL WHERE CCSHORT = 'CCSELDD'";
RS2TEST.CursorType = 0;
RS2TEST.CursorLocation = 2;
RS2TEST.LockType = 1;
RS2TEST.Open();
var RS2TEST_numRows = 0;
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
RS2TEST_numRows += Repeat1__numRows;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Unbenanntes Dokument</title>
</head>
<body>
<%=ccsvar%>
<table border="1">
<tr>
<td>CCUID</td>
<td>CCLONG</td>
<td>CCSHORT</td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!RS2TEST.EOF)) { %>
<tr>
<td><%=(RS2TEST.Fields.Item("CCUID").Value)%></td>
<td><%=(RS2TEST.Fields.Item("CCLONG").Value)%></td>
<td><%=(RS2TEST.Fields.Item("CCSHORT").Value)%></td>
</tr>
<%
Repeat1__index++;
RS2TEST.MoveNext();
}
%>
</table>
</body>
</html>
<%
RS2TEST.Close();
%>
Mein Problem ist dass ich keine records im rs angezeigt bekomme wenn ich die SQL abfrage mit einer Variable dynamisch gestalte. Aber auch keine Fehlermeldeung !
Wenn ich anstelle der Variable nach dem WHERE Statement den definitiven Strin setze zeigt er die gefilterten records im rs auch korrekt an nur mit der variable haut das nicht hin.
Testserver ist lokal iis 5.0 auf win 2000 alle wichtigen komponenten für asp sind up to date...
ich hoffe es kann mir jemand helfen.
vielen Dank schon mal im voraus.
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="../../Connections/AC2KDBCONN.asp" -->
<%
var ccsvar=Request.Form("CCSELDD") <-- hat den wert nach dem die DB gefiltert werden soll und wird auch korrekt im Body ausgegeben.
var RS2TEST = Server.CreateObject("ADODB.Recordset");
RS2TEST.ActiveConnection = "dsn=ACADEMY;";
RS2TEST.Source = "SELECT * FROM CC_SEL_TBL WHERE CCSHORT = 'CCSELDD'";
RS2TEST.CursorType = 0;
RS2TEST.CursorLocation = 2;
RS2TEST.LockType = 1;
RS2TEST.Open();
var RS2TEST_numRows = 0;
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
RS2TEST_numRows += Repeat1__numRows;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Unbenanntes Dokument</title>
</head>
<body>
<%=ccsvar%>
<table border="1">
<tr>
<td>CCUID</td>
<td>CCLONG</td>
<td>CCSHORT</td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!RS2TEST.EOF)) { %>
<tr>
<td><%=(RS2TEST.Fields.Item("CCUID").Value)%></td>
<td><%=(RS2TEST.Fields.Item("CCLONG").Value)%></td>
<td><%=(RS2TEST.Fields.Item("CCSHORT").Value)%></td>
</tr>
<%
Repeat1__index++;
RS2TEST.MoveNext();
}
%>
</table>
</body>
</html>
<%
RS2TEST.Close();
%>