Public Function GetAuctionItemsBySearch(SearchText, PathToPage)
Set Conn = CreateObject("ADODB.Connection")
Conn.ConnectionString = "PROVIDER=SQLOLEDB;DATA SOURCE=" & svrName _
& ";INITIAL CATALOG=" & dbName & ";USER ID=" & userId _
& ";PASSWORD=" & passWd
Conn.Open
Dim RSItems As ADODB.Recordset
Dim TempReturn As String
Set RSItems = Conn.Execute("Select auctionitem_id,productname, " _
& "currentbid,numbid,closingdate from auctionitem " _
& "where productname Like '%" & SearchText & "%' or " _
& "description Like '&" & SearchText & "%'")
TempReturn = "<TABLE BORDER=1 CELLSPACING=3 CELLPADDING=1 WIDTH = 465>" _
& "<TR><TD WIDTH=143>
Product Name" _
& "</TD><TD WIDTH=90>
Current Bid" _
& "</TD><TD WIDTH=51>
# Bids" _
& "</TD><TD WIDTH=148>
Closes" _
& "</TD></TR>" & vbNewLine
Do Until RSItems.EOF
TempReturn = TempReturn & "<TR>" _
& "<TD WIDTH=143>
" & RSItems("productname") & "</TD>" _
& "<TD WIDTH=90>
" _
& FormatCurrency(RSItems("currentbid")) & "</TD>" _
& "<TD WIDTH= 51>
" _
& RSItems("numbid") & "</TD>" _
& "<TD WIDTH= 148>
" _
& RSItems("closingdate") & "</TD></TR>" & vbNewLine
RSItems.MoveNext
Loop
TempReturn = TempReturn & "</TABLE>" & vbNewLine
GetAuctionItemsBySearch = TempReturn
End Function
Public Function GetSubCategoriesBySearch(SearchText, PathToPage)
Dim Conn
Dim svrName ' database server name
Dim dbName ' database name
Dim userId ' user id
Dim passWd ' password
'Initialise variables
svrName = "rox-oin2stqk26k"
dbName = "fyp"
userId = "abc"
passWd = "abc"
'Open connection to DB
Set Conn = CreateObject("ADODB.Connection")
Conn.ConnectionString = "PROVIDER=SQLOLEDB;DATA SOURCE=" & svrName _
& ";INITIAL CATALOG=" & dbName & ";USER ID=" & userId _
& ";PASSWORD=" & passWd
Conn.Open
Dim RSCategories As ADODB.Recordset
Dim TempReturn As String
Dim RowCount
Set RSCategories = Conn.Execute("Select cat_name from " _
& "Categories where cat_name = '%" _
& SearchText & "%' Order by cat_name")
TempReturn = "<TABLE BORDER = 0 CELLSPACING=0 CELLPADDING=2 Width = 120 > " _
& "<TR><TD> WIDTH=116 BGCOLOR =""#cccc99"">
" _
& "" _
& "Sub Categories</TD></TR>" & vbNewLine
RowCount = 1
Do Until RSCategories.EOF
TempReturn = TempReturn & "<TR>" _
& "<TD WIDTH=116 BGCOlOR=""#cccc99"">
" _
& RSCategories("cat_name") & "</TD>" _
& "</TR>" & vbNewLine
RSCategories.MoveNext
RowCount = RowCount + 1
Loop
If RowCount < 10 Then
Do Until RowCount = 10
TempReturn = TempReturn & "<TR>" _
& "<TD BGCOLOR=""#CCCC99""> </TD>" _
& "</TR>" & vbNewLine
RSCategories.MoveNext
RowCount = RowCount + 1
Loop
End If
TempReturn = TempReturn & "</Table>"
GetSubCategoriesBySearch = TempReturn
End Function
Dim MyAuction
Dim ThePath
Dim TheSubs
Dim TheProducts
Set MyAuction= Server.CreateObject("Auction.AuctionData")
If not IsEmpty(Request.Form("GoSearch")) Then
ThePath = ""
TheSubs = MyAuction.GetSubCategoriesBySearch(Request.Form("SearchText"),"./auction_list.asp")
TheProducts = MyAuction.GetAuctionItemsBySearch(Request.Form("SearchText"),"./auction_list.asp")
ElseIf not IsEmpty(Request.Form("GoBrowse")) Then
ThePath= MyAuction.GetCategoryPath(Request.Form("Category"),"./auction_list.asp")
TheProducts= MyAuction.GetAuctionItemsByCategory(Request.Form("Category"),"./auction_list.asp")
Elseif not IsEmpty(Request.QueryString("CategoryName")) Then
ThePath = MyAuction.GetCategoryPath(Request.QueryString("CategoryName"),"./auction_list.asp")
TheSubs = MyAuction.GetSubCategories(Request.QueryString("CategoryName"),"./auction_list.asp")
TheProducts = MyAuction.GetAuctionItemsByCategory(Request.QueryString("CategoryName"),"./auctionitem.asp")
Else
Response.Redirect "./auction_menu.asp"
End If
The first file is component I ve created using VB. In it are similiar methods/functions. For method, i have a new connection to DB. The second asp file is calling a method from the component. I checked and checked but I have this recordset error??????????? This error is quite new to me and I can't quite solve my current problem
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/Auction_List.asp, line 14
Any idea on whats wrong with it??

Set Conn = CreateObject("ADODB.Connection")
Conn.ConnectionString = "PROVIDER=SQLOLEDB;DATA SOURCE=" & svrName _
& ";INITIAL CATALOG=" & dbName & ";USER ID=" & userId _
& ";PASSWORD=" & passWd
Conn.Open
Dim RSItems As ADODB.Recordset
Dim TempReturn As String
Set RSItems = Conn.Execute("Select auctionitem_id,productname, " _
& "currentbid,numbid,closingdate from auctionitem " _
& "where productname Like '%" & SearchText & "%' or " _
& "description Like '&" & SearchText & "%'")
TempReturn = "<TABLE BORDER=1 CELLSPACING=3 CELLPADDING=1 WIDTH = 465>" _
& "<TR><TD WIDTH=143>
Product Name" _
& "</TD><TD WIDTH=90>
Current Bid" _
& "</TD><TD WIDTH=51>
# Bids" _
& "</TD><TD WIDTH=148>
Closes" _
& "</TD></TR>" & vbNewLine
Do Until RSItems.EOF
TempReturn = TempReturn & "<TR>" _
& "<TD WIDTH=143>
" & RSItems("productname") & "</TD>" _
& "<TD WIDTH=90>
" _
& FormatCurrency(RSItems("currentbid")) & "</TD>" _
& "<TD WIDTH= 51>
" _
& RSItems("numbid") & "</TD>" _
& "<TD WIDTH= 148>
" _
& RSItems("closingdate") & "</TD></TR>" & vbNewLine
RSItems.MoveNext
Loop
TempReturn = TempReturn & "</TABLE>" & vbNewLine
GetAuctionItemsBySearch = TempReturn
End Function
Public Function GetSubCategoriesBySearch(SearchText, PathToPage)
Dim Conn
Dim svrName ' database server name
Dim dbName ' database name
Dim userId ' user id
Dim passWd ' password
'Initialise variables
svrName = "rox-oin2stqk26k"
dbName = "fyp"
userId = "abc"
passWd = "abc"
'Open connection to DB
Set Conn = CreateObject("ADODB.Connection")
Conn.ConnectionString = "PROVIDER=SQLOLEDB;DATA SOURCE=" & svrName _
& ";INITIAL CATALOG=" & dbName & ";USER ID=" & userId _
& ";PASSWORD=" & passWd
Conn.Open
Dim RSCategories As ADODB.Recordset
Dim TempReturn As String
Dim RowCount
Set RSCategories = Conn.Execute("Select cat_name from " _
& "Categories where cat_name = '%" _
& SearchText & "%' Order by cat_name")
TempReturn = "<TABLE BORDER = 0 CELLSPACING=0 CELLPADDING=2 Width = 120 > " _
& "<TR><TD> WIDTH=116 BGCOLOR =""#cccc99"">
" _
& "" _
& "Sub Categories</TD></TR>" & vbNewLine
RowCount = 1
Do Until RSCategories.EOF
TempReturn = TempReturn & "<TR>" _
& "<TD WIDTH=116 BGCOlOR=""#cccc99"">
" _
& RSCategories("cat_name") & "</TD>" _
& "</TR>" & vbNewLine
RSCategories.MoveNext
RowCount = RowCount + 1
Loop
If RowCount < 10 Then
Do Until RowCount = 10
TempReturn = TempReturn & "<TR>" _
& "<TD BGCOLOR=""#CCCC99""> </TD>" _
& "</TR>" & vbNewLine
RSCategories.MoveNext
RowCount = RowCount + 1
Loop
End If
TempReturn = TempReturn & "</Table>"
GetSubCategoriesBySearch = TempReturn
End Function
Dim MyAuction
Dim ThePath
Dim TheSubs
Dim TheProducts
Set MyAuction= Server.CreateObject("Auction.AuctionData")
If not IsEmpty(Request.Form("GoSearch")) Then
ThePath = ""
TheSubs = MyAuction.GetSubCategoriesBySearch(Request.Form("SearchText"),"./auction_list.asp")
TheProducts = MyAuction.GetAuctionItemsBySearch(Request.Form("SearchText"),"./auction_list.asp")
ElseIf not IsEmpty(Request.Form("GoBrowse")) Then
ThePath= MyAuction.GetCategoryPath(Request.Form("Category"),"./auction_list.asp")
TheProducts= MyAuction.GetAuctionItemsByCategory(Request.Form("Category"),"./auction_list.asp")
Elseif not IsEmpty(Request.QueryString("CategoryName")) Then
ThePath = MyAuction.GetCategoryPath(Request.QueryString("CategoryName"),"./auction_list.asp")
TheSubs = MyAuction.GetSubCategories(Request.QueryString("CategoryName"),"./auction_list.asp")
TheProducts = MyAuction.GetAuctionItemsByCategory(Request.QueryString("CategoryName"),"./auctionitem.asp")
Else
Response.Redirect "./auction_menu.asp"
End If
The first file is component I ve created using VB. In it are similiar methods/functions. For method, i have a new connection to DB. The second asp file is calling a method from the component. I checked and checked but I have this recordset error??????????? This error is quite new to me and I can't quite solve my current problem
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/Auction_List.asp, line 14
Any idea on whats wrong with it??