Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 2nd, 2004, 01:25 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

fName = request.form("fName")
sName = request.form("sName")
Dept = request.form("Dept")

set rs = server.createobject("adodb.recordset")
sql = "select * from Users"
rs.open sql, data_source, 3, 3

    rs.addnew
    rs("Name") = fName
    rs("Surname") = sName
    rs("Department") = Dept
    rs.update

 
Old November 9th, 2006, 05:12 AM
Registered User
 
Join Date: Nov 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi to all! 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 (). 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
%>
 
Old November 9th, 2006, 02:20 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Take Imar's advice and don't use that Add stuff. I've found nothing but problems with using that method. I gave it up a long time ago and things have gone smoothly ever since.








Similar Threads
Thread Thread Starter Forum Replies Last Post
arguments relay pierre.voisin Javascript 1 February 20th, 2008 06:04 PM
Arguments are of the wrong type, are out of accep jenpitts ASP.NET 2.0 Basics 3 August 14th, 2007 03:00 PM
CreateParameter - wrong type rit01 Classic ASP Databases 2 February 2nd, 2006 08:39 PM
Query on the wrong data type ggiibboo VB Databases Basics 1 January 31st, 2006 07:44 PM
Arguments snowy0 VB.NET 2002/2003 Basics 3 September 3rd, 2004 08:40 AM





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