Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 23rd, 2005, 03:42 AM
Registered User
 
Join Date: Nov 2005
Location: Lahore, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADODB.RecordSet -- Error

I HAVE THIS CODE IN MY WEBSITE:

<%@ language="vbscript" %>


<%


dim rsData
dim intPage
dim intTotalPages
dim fldf
dim intRec
dim strQuote
dim strScriptName

strQuote= chr(34)

set rsData=Server.CreateObject ("ADODB.Recordset")


rsData.pagesize=10
rsData.CursorLocation = adUseClient


rsData.Open "mydb", strConn, adOpenForwardOnly, adLockReadOnly, adCmdTable


If request.querystring ("page")="" Then
    intPage=1
Else

    If intPage<1 Then
    intPage=1

    Else

    If intPage>rsData.PageCount Then
    intPage=rsData.PageCount

    Else

    intPage=CInt(request.querystring("page"))

End If

End If

End If


rsData.AbsolutePage=intPage


Response.Write "<table border=1><thead><tr>"
For each fldf in rsData.Fields
    Response.Write "<td>" &fldf.Name&"</td>"
Next
Response.Write "</tr></thead><tbody>"


For intRec=1 To rsData.PageSize

    If Not rsData.EOF Then
    Response.Write "<tr>"

    For Each fldf in rsData.Fields
    Response.Write "<td>"&fldf.value& "</td>"

    Next

    Response.Write "</tr>"

    rsData.MoveNext

End If

Next

Response.Write "</tbody></thead></table>"


%>



AND I RECEIVE THIS ERROR WHEN I RUN IT.


Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/working/dbin.asp, line 21


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)



PLEASE GUIDE ME WHAT TO DO.

NABEEL JOHN


Nabeel John
0300-4124086
Reply With Quote
  #2 (permalink)  
Old November 23rd, 2005, 05:12 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Nabeel,

I guess line 21 must be this one:

rsData.Open "mydb", strConn, adOpenForwardOnly, adLockReadOnly, adCmdTable

Have you set the value of strConn anywhere?

Do you have a table called mydb in your database?

Cheers,

Chris

Reply With Quote
  #3 (permalink)  
Old November 23rd, 2005, 09:52 AM
Registered User
 
Join Date: Nov 2005
Location: Lahore, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Chris,

Where to set the value of strConn?
Also tell me what it actually does?

I've an Access 2000 Database its name is "mydb" in ODBC, and its file name is also "mydb"

And it has a table called "pInfo" and has two fields "Name" & "EMail"..

Now Please guide me.

Hoping to hear from you soon.


Nabeel John
0300-4124086
Reply With Quote
  #4 (permalink)  
Old November 23rd, 2005, 12:46 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey Nabeel,

You need to use a valid connection string to your database in connStr, http://www.connectionstrings.com should set you on the right track (you could also use a connection object in place of a connection string, but you need a connection string to open that as well).

If you are opening the "pInfo" table with your recordset, the first parameter needs to be "pInfo" and not "mydb".

HTH,

Chris



Reply With Quote
  #5 (permalink)  
Old November 23rd, 2005, 05:48 PM
Registered User
 
Join Date: Nov 2005
Location: Lahore, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

CHRIS, WITH THIS CODE I RECEIVED THE SAME ERROR. PLEASE NOTE THAT I HAVE MY DATABASE IN ODBC W/DSN.
NOW WHAT TO DO?

---------------------------------------------------------------
set database=Server.CreateObject ("ADODB.Connection")
database.Open "mydb"

set rsData=Server.CreateObject ("ADODB.Recordset")


rsData.pagesize=10
rsData.CursorLocation = adUseClient


rsData.Open "pInfo",database, adOpenForwardOnly, adLockReadOnly, adCmdTable


Nabeel John
0300-4124086
Reply With Quote
  #6 (permalink)  
Old November 23rd, 2005, 07:34 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Nabeel John,

Looks like you haven't defined the constants like adOpenForwardOnly, adLockReadOnly and adCmdTable. Take a look at this FAQ to find out how to make those available in your code:

http://Imar.Spaanjaars.Com/QuickDocId.aspx?QUICKDOC=332

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Wake Up by Rage Against The Machine (Track 7 from the album: Rage Against The Machine) What's This?
Reply With Quote
  #7 (permalink)  
Old November 24th, 2005, 04:29 AM
Registered User
 
Join Date: Nov 2005
Location: Lahore, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar,

It worked!

One more thing I want to know, how would this work if the user didnt have this file(msado15.dll) on his/her computer? Can I include it virutally or from my ISP's server or from my web hosting server? for I'm hosting my website on www.serversea.com

Cheers,
Nabeel



Nabeel John
0300-4124086
Reply With Quote
  #8 (permalink)  
Old November 24th, 2005, 06:47 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

The end user has nothing to do with this; this is a server side setting.

Depending on the configuration of your server with your ISP, you can try method 3. If that doesn't work, upload a copy of the file from your own machine to your server and then use method 2.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #9 (permalink)  
Old November 24th, 2005, 05:23 PM
Registered User
 
Join Date: Nov 2005
Location: Lahore, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar, it worked!

Nabeel John
0300-4124086
Reply With Quote
  #10 (permalink)  
Old November 9th, 2006, 05:15 AM
Registered User
 
Join Date: Nov 2006
Location: Manila, , Philippines.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi to all. Can someone help me with my code?
I'm new to ASP so I'm kinda having difficulties with coding.

I've been trying to fix it for two days and nothing happened.
It always gives me the same error:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

And it says that there is something wrong with line 4.

I am using two files here. The first one is an asp file (expprof.asp) which includes a database connection file (). And another file (expeduc.asp) which is also included in the first file ().
What I want is for expeduc.asp to display information from the database, that is, if the database contains the "id" of the person displayed in expprof.asp, otherwise, display an ADD form to add information related again, to the person displayed in expprof.asp

<%
  Set rsNum = Server.CreateObject("ADODB.Recordset")
  numSQL = "select * from educations where exp_id = " & Request.QueryString("id") & ";"
  rsNum.Open numSQL, adoCon, 3, 3 ---> this line is said to have the error

  'count the number of records the person has in the educations table
  cnt = rsNum.RecordCount

  'if there are no records then the system must require the user to enter the information in the form below
  If (cnt < 1) Then
  %>
    <form name="addeduc" action="expeduc.asp?inc=1&id=<% Request.QueryString("id") %>&view=1" method="post">
    <table align="center">
     <tr><td align="center" colspan="2">Education</td></tr>
     <tr><td colspan="2"></td></tr>
     <tr>
      <td>Education:</td>
      <td><input type="text" name="educ" size="30"></td>
     </tr>
     <tr><td colspan="2" align="center"><input type="submit" name="Submit" value="Add"></td></tr>
    </table>
    </form>
  <%
     Set rsEduc = Server.CreateObject("ADODB.Recordset")
     educSQL = "select * from educations"
     rsEduc.Open educSQL, adoCon, 2, 3
     rsEduc.AddNew
     rsEduc.Fields("exp_id") = Request.QueryString("id")
     rsEduc.Fields("education") = Request.Form("educ")
     rsEduc.Update
     'rsEduc.Close
     'Response.Redirect("expeduc.asp")
     'Response.Write("Add Something")
  Else
     'display the Education when there is a record found in the database
     Response.Write(rsNum.Fields(2))
  End If
%>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Recordset error lance Wrox Book Feedback 2 February 23rd, 2007 02:37 PM
ADODB.Recordset error '800a0e78' nancy Classic ASP Databases 6 September 1st, 2004 09:42 AM
ADODB.Recordset error '800a0cb3' klittlejohn SQL Server ASP 2 January 19th, 2004 10:17 PM
ADODB.Recordset error '800a0cb3' jmss66 Classic ASP Databases 1 July 16th, 2003 04:18 PM



All times are GMT -4. The time now is 05:27 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.