KB Issue
When you are trying to query your table, your QueryString may not be properly defined. (or) If you are sending too many characters to your Parameter with a set Character Length.
Issue Details
If your QueryString is not properly defined or misspelled, you will receive this error
ADODB.Command error '800a0d5d'
Application uses a value of the wrong type for the current operation.
rss.asp, line 8
Scenaria #2:
If you are trying to send too many characters to your Parameterized Query.
ADODB.Command (0x800A0D5D)
Application uses a value of the wrong type for the current operation.
Inserts.asp, line 290
Recreate Issue
In the below SQL Query, we are getting our ID from the QueryString
Copy
Search Site
Search Google
of rss.
Code Example
rss = ProtectSQL(request.QueryString("rss"))
Set sqlRSS = Server.CreateObject("ADODB.Command")
sqlRSS.ActiveConnection=objConn
sqlRSS.Prepared = true
sqlRSS.commandtext="Select id, RSSFeed FROM MyTable WHERE id=? AND RSSFeed=1"
sqlRSS.Parameters.Append sqlRSS.CreateParameter("@id", adInteger, adParamInput, , rss)
set rsRSS = sqlRSS.execute
We instead Query our string as:
page.asp?rsss=1
Copy
Search Site
Search Google
Scenaria #2:
Code Example

Set sqlFFiltnd = CreateObject("ADODB.Command")
sqlFFiltnd.ActiveConnection=objConn
sqlFFiltnd.commandtext="update DTable set DFolder='NotDefault' where id=? and PicsFolder=?"
sqlFFiltnd.Parameters.Append sqlFFiltnd.CreateParameter("@id", 3, 1, , MineID)
sqlFFiltnd.Parameters.Append sqlFFiltnd.CreateParameter("@PFolder", 200, 1, 25, strFolderName)
sqlFFiltnd.execute
In the code above, the 5th line, our PFolder, has a character count of 25. This will cause this error if you have over 25 characters to go into the field.
Resolve Issue
To correctly call our Query, we need to make sure that our QueryString
Copy
Search Site
Search Google
matches our Variable
Copy
Search Site
Search Google
that we define within our code.
page.asp?rss=1
Copy
Search Site
Search Google
Will get our records and display them back to us properly
.


Code Example
rss = ProtectSQL(request.QueryString("rss"))
Set sqlRSS = Server.CreateObject("ADODB.Command")
sqlRSS.ActiveConnection=objConn
sqlRSS.Prepared = true
sqlRSS.commandtext="Select id, RSSFeed FROM MyTable WHERE id=? AND RSSFeed=1"
sqlRSS.Parameters.Append sqlRSS.CreateParameter("@id", adInteger, adParamInput, , rss)
set rsRSS = sqlRSS.execute
Scenaria #2:
Code Example

Set sqlFFiltnd = CreateObject("ADODB.Command")
sqlFFiltnd.ActiveConnection=objConn
sqlFFiltnd.commandtext="update DTable set DFolder='NotDefault' where id=? and PicsFolder=?"
sqlFFiltnd.Parameters.Append sqlFFiltnd.CreateParameter("@id", 3, 1, , MineID)
sqlFFiltnd.Parameters.Append sqlFFiltnd.CreateParameter("@PFolder", 200, 1, 75, strFolderName)
sqlFFiltnd.execute
On line #5, we have changed the Character count from 25 allowed Characters to 75. This gives us more room to allow for special characters, especially if you are using a function to convert characters over to hex or so forth.