gpalmer711
IS-IT--Management
I am having some problems with some ASP code, which was working fine before I went to bed last night. However it is now not working and I don't remember changing anything.
The problem is with intRecordsAffected, even if there are more than 0 records returned then intRecordsAffected = 0
If I comment out the IF block and just leave the code that executes after the ELSE statement then the page displays as expected.
Anyone see any problems with this?
Greg Palmer
Freeware Utilities for Windows Administrators.
Code:
Dim objRS,objConn,strID,strProduct
Set objRS = Server.CreateObject("ADODB.Recordset")
set objConn = Server.CreateObject("ADODB.Connection")
mySQL = "SELECT * FROM products WHERE ProductID =" & Request.QueryString("product")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("mvpdb") & "/faqs.mdb;Jet OLEDB:Database Password=<MYPASSWORD>;"
objRS.Open mySQL,objConn,3,3
Response.Write "<br>"
Response.write "<font face=""Arial""><h1 align=""center"">" & objRS("product_name") & "</h1></font>"
Response.Write "<p align=""center"">"
response.write "<img src=""logos/" & objRS("image") & """ alt=""" & objRS("product_name") & """>"
response.write "<br><br>"
'objRS.Close
'objConn.Close
mySQL = "SELECT * FROM sites WHERE product_ID=" & Request.QueryString("product")
'objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("mvpdb") & "/faqs.mdb;Jet OLEDB:Database Password=<MYPASSWORD>;"
set objRS = objConn.Execute(mySQL,intRecordsAffected)
if intRecordsAffected =< 0 Then
Response.Write "We currently do not have any FAQs for this product, please try back again soon." & intRecordsAffected & mySQL
else
REST OF CODE HERE
The problem is with intRecordsAffected, even if there are more than 0 records returned then intRecordsAffected = 0
If I comment out the IF block and just leave the code that executes after the ELSE statement then the page displays as expected.
Anyone see any problems with this?
Greg Palmer
Freeware Utilities for Windows Administrators.