Good Afternoon,
I have an HTML form in which users input a list of comma delimited numbers. Those numbers are then displayed in a table with other corresponding information from the database. The part I am having trouble with, is that I need to display a distinct count of the KA_ID field below the table. I've tried doing it in an SQL statement and I've tried doing it by using rs.RecordCount. Neither method has worked for me yet.
Does anyone have any ideas? Here is my code:
dim str1, str3, i
str1 = Replace(Request.Form("searchvalue","'","''"
str3 = split(str1,","
for i = 0 to ubound(str3)
Set RS = Server.createobject("ADODB.Recordset"
Set MyConn = Server.CreateObject("ADODB.Connection"
MyConn.Open "UID=xxxxxxx;pwd=xxxxxx;DRIVER={Microsoft ODBC for Oracle};SERVER=xxxxxx"
SQL = "select KA_ID,BUG_ID, CREATED_BY from KA where BUG_ID like '%"&str3(i)&"%'"
RS.Open SQL, MyConn, 1, 1
If RS.EOF <> true Then
Do while RS.EOF <> true
Response.Write "<tr><td class='left'>" & str3(i) & "</td><td class='center'><img src='blue.gif'></td><td>" & RS("KA_ID" & "</td><td>" & RS("CREATED_BY" & "</td>"
rs.MoveNext
Loop
Else
Response.Write "<tr><td class='left'>" & str3(i) & "</td><td class='center'>~</td><td>~</td><td>~</td><td>~</td>"
End If
next
Response.Write "</table></td></tr></table></body></html>"
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
%>
Any help is appreciated!
Best Regards,
Carla
I have an HTML form in which users input a list of comma delimited numbers. Those numbers are then displayed in a table with other corresponding information from the database. The part I am having trouble with, is that I need to display a distinct count of the KA_ID field below the table. I've tried doing it in an SQL statement and I've tried doing it by using rs.RecordCount. Neither method has worked for me yet.
Does anyone have any ideas? Here is my code:
dim str1, str3, i
str1 = Replace(Request.Form("searchvalue","'","''"
str3 = split(str1,","
for i = 0 to ubound(str3)
Set RS = Server.createobject("ADODB.Recordset"
Set MyConn = Server.CreateObject("ADODB.Connection"
MyConn.Open "UID=xxxxxxx;pwd=xxxxxx;DRIVER={Microsoft ODBC for Oracle};SERVER=xxxxxx"
SQL = "select KA_ID,BUG_ID, CREATED_BY from KA where BUG_ID like '%"&str3(i)&"%'"
RS.Open SQL, MyConn, 1, 1
If RS.EOF <> true Then
Do while RS.EOF <> true
Response.Write "<tr><td class='left'>" & str3(i) & "</td><td class='center'><img src='blue.gif'></td><td>" & RS("KA_ID" & "</td><td>" & RS("CREATED_BY" & "</td>"
rs.MoveNext
Loop
Else
Response.Write "<tr><td class='left'>" & str3(i) & "</td><td class='center'>~</td><td>~</td><td>~</td><td>~</td>"
End If
next
Response.Write "</table></td></tr></table></body></html>"
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
%>
Any help is appreciated!
Best Regards,
Carla