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: '
- Article ID:
88 - Date Created
Monday, January 3, 2011 - This Article Has been Viewed
2716 times - Short Desc
When you use a RecordSet to check if something exist or not, you have to make sure that the recordset if actually being used in the Queried page. - Details
When you use a RecordSet to check if something exist or not, you have to make sure that the recordset if actually being used in the Queried page. If it is not being used, then you will recieve the following error.
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/Comment.asp, line 15 - Recreate Issue
To recreate this issue.
In this demostration we are going to be on page:
page.asp?Type=Value
Now, in the script, we are going to do this:
<%
if request.querystring("Type")="Home" then
Set sql = Server.CreateObject("ADODB.Command")
sqlch.ActiveConnection=RHCConn
sqlch.Prepared = true
sqlch.commandtext="select pid, dsid from MyTable where pid=? and sid=?"
sqlch.Parameters.Append sqlchFriends.CreateParameter("@pid", adInteger, adParamInput, , getid)
set rsch = sqlch.execute
end if
%>
Now, in the above demostration, we are on page:
page.asp?Type=Value
And the RecordSet that we are needing to get our Query from is hidden in
page.asp?Type=Home
So we cannot use it Values until we correct the issue. - Resolve Issue
To resolve this issue:
OK, as demostrated in the above scenario, we have a page.asp?Type=Value that is trying to use the the RecordSet rsch
Now, due to the fact that it is hidden behind another Query name, we are unable to use it.
So, lets correct this issue now.
<%
if request.querystring("Type")="Home" or request.querystring("Type")="Value" then
Set sql = Server.CreateObject("ADODB.Command")
sqlch.ActiveConnection=RHCConn
sqlch.Prepared = true
sqlch.commandtext="select pid, dsid from MyTable where pid=? and sid=?"
sqlch.Parameters.Append sqlchFriends.CreateParameter("@pid", adInteger, adParamInput, , getid)
set rsch = sqlch.execute
end if
%>
As you can see in the above, instead of creating another RecordSet to be used in another aarea, we instead added the OR to add in another QueryString to check for to use.
Now, this will run and we can use the rsch recordset in both places.
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