alwaysAnewbie
Programmer
I have an ASP web page thet I changed to query from one DB to another. The code worked previously. The connection is fine and data is returned but highlighted if is failing:
Here is the output:
The form var is from the form. The SQL var is what is returned from the DB. The False after the value parameter is the statement evaluation. I have tried the value parameter with and without quotes with no change.
Any ideas?
Code:
<%
company = REQUEST.FORM("company")
response.write "form var =|" & company & "|"
Dim conn, strSQL, rsRes, ConnStr
Set conn = Server.CreateObject("ADODB.Connection")
ConnStr = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=blah;" & _
"Password=Blahblah;database=Yeah_right;Data Source=MyServer"
conn.Open ConnStr
set rsRes = Server.CreateObject("ADODB.Recordset")
strSQL="SELECT OrgCodeIdNo, OrganizationDescription " & _
"FROM tORGANIZATIONS " & _
"WHERE (OrganizationTypeIdNo = 16) " & _
"ORDER BY OrganizationTypeIdNo, OrganizationDescription"
Set rsRes = Conn.Execute(strSQL)
Do While Not rsRes.EOF
response.write "SQL var =|" & rsRes("OrgCodeIdNo") & "|"
Response.write "<option class='normal' value=" & """" & rsRes("OrgCodeIdNo") & """"
response.write "eval=|" & rsRes("OrgCodeIdNo") = company & "|"
[b] if rsRes("OrgCodeIdNo") = company then
Response.write " selected"
end if[/b]
response.write ">" & rsRes("OrganizationDescription") & "</option>"
rsRes.movenext
loop
rsRes.Close
set rsRes = nothing
Here is the output:
Code:
form var =|277|
SQL var =|275|<option class='normal' value="275"False>Geriatric Care Services</option>
SQL var =|277|<option class='normal' value="277"False>Life Services</option>
SQL var =|280|<option class='normal' value="280"False>Lutheran Senior Life</option>
SQL var =|282|<option class='normal' value="282"False>Passavant Retirement Center</option>
SQL var =|287|<option class='normal' value="287"False>St John Lutheran Care Center</option>
The form var is from the form. The SQL var is what is returned from the DB. The False after the value parameter is the statement evaluation. I have tried the value parameter with and without quotes with no change.
Any ideas?