p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Basics (http://p2p.wrox.com/forumdisplay.php?f=61)
-   -   Wrong argument types (http://p2p.wrox.com/showthread.php?t=42261)

michael1p May 8th, 2006 10:05 AM

Wrong argument types
Hi im really new to this asp lark and wondered if anyone could give me some help. I keep getting ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/MyWeb/inc_menu.asp, line 13.

Dim CaseStudy__MMColParam
CaseStudy__MMColParam = "y"
If (Request("MM_EmptyValue") <> "") Then
  CaseStudy__MMColParam = Request("MM_EmptyValue")
End If
Dim CaseStudy
Dim CaseStudy_numRows

Set CaseStudy = Server.CreateObject("ADODB.Recordset")
CaseStudy.ActiveConnection = MM_AdminandIntra_STRING
CaseStudy.Source = "SELECT * FROM tblCaseStudy WHERE csFeatured = '" + Replace(CaseStudy__MMColParam, "'", "''") + "'"
CaseStudy.CursorType = 0
CaseStudy.CursorLocation = 2
CaseStudy.LockType = 1

CaseStudy_numRows = 0

woodyz May 8th, 2006 12:53 PM

I suspect that the value in your MM_AdminandIntra_STRING variable is empty or incorrect...

This error message can show up in several ways, and this is one of them.

Hope that helps

Woody Z http://www.learntoprogramnow.com

uderodriguezjr November 9th, 2006 04:59 AM

Can someone help me with my code?

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 (<!--#include file="dbconnect.asp">). And another file (expeduc.asp) which is also included in the first file (<!--#include file="expeduc.asp">).
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>
      <td><input type="text" name="educ" size="30"></td>
     <tr><td colspan="2" align="center"><input type="submit" name="Submit" value="Add"></td></tr>
     Set rsEduc = Server.CreateObject("ADODB.Recordset")
     educSQL = "select * from educations"
     rsEduc.Open educSQL, adoCon, 2, 3
     rsEduc.Fields("exp_id") = Request.QueryString("id")
     rsEduc.Fields("education") = Request.Form("educ")
     'Response.Write("Add Something")
     'display the Education when there is a record found in the database
  End If

dparsons November 9th, 2006 10:29 AM

Remove your cursor and lock and see if you can execute the query.

e.g. change this:
rsNum.Open numSQL, adoCon, 3, 3

to this:
rsNum.Open numSQL, adoCon

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature

All times are GMT -4. The time now is 12:32 AM.

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