CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
Microsoft VBScript runtime (0x800A01A8) Object required: 'rsSearch'
- Article ID:
43 - Date Created
Tuesday, November 16, 2010 - Last Updated
Wednesday, November 17, 2010 - This Article Has been Viewed
1986 times - Short Desc
When using RecordSets, you must make sure that you have the CreateObject, if not this error will accure. - Details
When using RecordSets in your project like a paging system, you will need to have the CreateObject for the RecordSet, if this is not supplied in the code, then you will recieve this error.
Microsoft VBScript runtime (0x800A01A8)
Object required: 'rsSearch'
/paging.asp, line 21
If you are using Paramaters in your code, and are working on something other than a Paging script, then this will (or) should not apply to your issue.
As calling Parameters, you create your RecordSet like so:
<%
set rsSearch = sqlServer.execute
%>
This creates the recordset for you, so you will not need the CreateObject. - Recreate Issue
To recreate this issue.
<%
=rsSearch("MyRecord")
%>
This will give you the error if you do not supply the CreateObject
<%
Set rsSearch=Server.CreateObject("ADODB.RecordSet")
%>
- Resolve Issue
To correct write your code, in this case, we are doing a paging system, so it will look like this.
<%
Set searchsql = CreateObject("ADODB.Command")
searchsql.ActiveConnection=objConn
searchsql.Prepared = true
Set rsSearch=Server.CreateObject("ADODB.RecordSet")
%>
The above will compile without the error.
As mentioned above in the description, this issue should not be a factor if you are doing something like this.
Parameterized Queries.
<%
Set searchsql = CreateObject("ADODB.Command")
searchsql.ActiveConnection=objConn
searchsql.Prepared = true
searchsql.commandtext="Select record1, record2 from table1"
set rsSearch = searchsql.execute
%>
The above does not need to CreateObject for the RecordSet
Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24695
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21297
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19544
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 17785
- The backup set holds a backup of a database other than the existing 16825