you're not using the rs.Open method.
remove the Con.Execute line and use the open method
'Set prodRS= Con.Execute(sqlString) 'don't use this!
Con.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\OnlineStore") & "\StoreDB.mdb"
Set prodRS= Server.CreateObject("ADODB.Recordset")
prodRS.CursorType = adOpenStatic
prodRS.AbsolutePage = pg
prodRS.PageSize = 5
sqlString = "SELECT * FROM Products " &_
"WHERE product_status = 1 " &_
"AND ( product_category LIKE '%" & product_category & "%' " &_
"OR product_brand LIKE '%" & product_brand & "%') " &_
"ORDER BY product_name "
prodRS.Open sqlString, Con
you should set all the needed properties of the recordset object before calling the open() method.
since you're using the constant adOpenStatic, make sure the adovbs.inc must be included in the asp page. Or you may just use the value 3.
remove the Con.Execute line and use the open method
'Set prodRS= Con.Execute(sqlString) 'don't use this!
Con.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\OnlineStore") & "\StoreDB.mdb"
Set prodRS= Server.CreateObject("ADODB.Recordset")
prodRS.CursorType = adOpenStatic
prodRS.AbsolutePage = pg
prodRS.PageSize = 5
sqlString = "SELECT * FROM Products " &_
"WHERE product_status = 1 " &_
"AND ( product_category LIKE '%" & product_category & "%' " &_
"OR product_brand LIKE '%" & product_brand & "%') " &_
"ORDER BY product_name "
prodRS.Open sqlString, Con
you should set all the needed properties of the recordset object before calling the open() method.
since you're using the constant adOpenStatic, make sure the adovbs.inc must be included in the asp page. Or you may just use the value 3.
No comments:
Post a Comment