Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Arguments are of the wrong type...connecting to Access DB

Reply
Thread Tools

Arguments are of the wrong type...connecting to Access DB

 
 
thecubemonkey
Guest
Posts: n/a
 
      10-03-2008
Hi everyone,

I'm getting the following error:

ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are
in conflict with one another.
/newsite/faq.asp, line 57

Can you look at the code below and let me know if the problem is my
code or if there is a server setting that needs adjustment. Thanks.

__________________________________________________ ________________________

I am using a global.asa file with:
SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart()

Dim strConn
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Departments
\MBA_UBALT\newsite\faq.mdb"
Application("strConn") = strConn

End Sub

</SCRIPT>

The ASP page code is:

<%
Dim rsFAQ
Set rsFAQ = Server.CreateObject("ADODB.Recordset")

rsFAQ.Open "FAQ", Application("strConn"), adOpenKeyset,
adLockReadOnly, adCmdText


Do While Not rsFAQ.EOF
Response.Write "<li><b>" & rsFAQ("Question") & "</b>"
Response.Write "<p>" & rsFAQ("Answer") & "</p></li>"
rsFAQ.MoveNext
Loop
If rsFAQ.BOF Then
Response.Write "<p>No FAQs in the database!</p>" & vbNewLine
End If

rsFAQ.Close
%>
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-03-2008
thecubemonkey wrote:
> Hi everyone,
>
> I'm getting the following error:
>
> ADODB.Recordset error '800a0bb9'
> Arguments are of the wrong type, are out of acceptable range, or are
> in conflict with one another.
> /newsite/faq.asp, line 57
>
> Can you look at the code below and let me know if the problem is my
> code or if there is a server setting that needs adjustment. Thanks.
>
> __________________________________________________ ________________________
>
> rsFAQ.Open "FAQ", Application("strConn"), adOpenKeyset,
> adLockReadOnly, adCmdText
>

This error is typically due to the failure to define those ado constants.
See:
http://www.aspfaq.com/show.asp?id=2112

That said, I have to say there is rarely a need to use other than the
default, server-side forward-only cursor type. This statement could be
changed to (assuming FAQ is a table in your database):

dim cn, rs
set cn = createobject("adodb.connection")
cn.open Application("strConn")
set rs = cn.Execute("select * from FAQ',,1)


Further relevant reading: http://www.aspfaq.com/show.asp?id=2096
http://www.aspfaq.com/show.asp?id=2467


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arguments are of the wrong type...connecting to Access DB thecubemonkey ASP General 0 10-03-2008 08:34 PM
how to pass a function name and its arguments inside the arguments of other function? jmborr Python 1 11-03-2007 08:20 AM
function default arguments from other arguments tutmann C++ 4 10-17-2006 08:00 PM
function call with arguments which takes no arguments Neo C Programming 10 01-20-2005 06:31 AM
Difference between default arguments and keyword arguments Edward Diener Python 14 04-05-2004 11:26 PM



Advertisments