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:
ADODB.Command error '800a0bb9' Arguments are of the wrong type
- Article ID:
3 - Date Created
Sunday, September 26, 2010 - Last Updated
Wednesday, November 17, 2010 - This Article Has been Viewed
6903 times - Short Desc
If you spell your connection string name incorrectly. - Details
When you write out your database connection string, sometimes you will leave out a letter when writting it back out to the sql statement.
The error that you get is:
ADODB.Command error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/MyFile.asp, line 114 - Recreate Issue
Lets say that you have this as your connection string
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("cffkb.mdb") & ";"
objConn.Open
%>
Now
you write out your sql parameter statement (or) simple sql query depending on the type of programmer that you are.
<%
Set sql = CreateObject("ADODB.Command")
sql.ActiveConnection=objCon ' This is the Connection Name.
sql.Prepared = true
sql.commandtext="select column1 from table1"
set rsGet = sql.execute
%>
As you see in the above line sql.ActiveConnection=objCon
The connection name is missing the last remaining n - Resolve Issue
To correct the issue.
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("cffkb.mdb") & ";"
objConn.Open
%>
<%
Set sql = CreateObject("ADODB.Command")
sql.ActiveConnection=objConn ' This is the Connection Name.
sql.Prepared = true
sql.commandtext="select column1 from table1"
set rsGet = sql.execute
%>
As you see, the connection object name is spelled objConn not objCon
So make sure that you spell your connection object name correctly.
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