Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > DataAdd Error: Arguments are wrong type or are out of acceptable r

Reply
Thread Tools

DataAdd Error: Arguments are wrong type or are out of acceptable r

 
 
Jack
Guest
Posts: n/a
 
      12-14-2004
Hi,
I am trying to add a new record to a main page. This page is the processing
page to a form. However, I am getting the following error message:

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

Line 41 is : rs1.Open "Main", 2, 2
Any help for the resolution is appreciated. Thanks

CODE:


<%@ Language = "VBScript"%>
<!-- #include file="adovbs.inc" -->
<%
Response.Buffer = true
'Declare all local variables

dim CN
dim RS
dim rs1
dim strSQL


'set a local variable to my DSN-less connection String
strconn = "DRIVER=Microsoft Access Driver
(*.mdb);DBQ=C:\_______GWISNEWCON\greytest.mdb"

'Verify user information in the database
'Create the connection and recorset objects, set the SQL String and parameters
'and open recordset
myDSN="DRIVER={Microsoft Access Driver (*.mdb)}; "
myDSN=myDSN & "DBQ=C:\_______GWISNEWCON\greytest.mdb"
set CN=server.createobject("ADODB.Connection")
set RS=server.createobject("ADODB.Recordset")
set rs1 = server.createobject("adodb.recordset")
CN.Open myDSN

RS.ActiveConnection=CN
rs1.ActiveConnection = CN

strSQL = "SELECT Main.IDNumber, Main.SocialSecurityNumber, Main.Password,
Main.FirstName, Main.LastName, Main.ColorPreference, Main.FoodPreference,
Main.FinalUpdate FROM Main where " & _
"SocialSecurityNumber ='" & Request.Form("txtSocialSecurity") & "'"
RS.Open strSQL
'Response.Write strSQL

'Check for empty recordset which indicates user information was not found
If RS.EOF or RS.BOF Then



'This statement opens the table so we can add a record notice the addnew
'The 2, 2 is how the table is opened there are many ways it can be opened
rs1.Open "Main", 2, 2
'Use the addnew method of the recordset object to add a record
rs.addnew
'Set the table column = to my input text box from my form
rs("SocialSecurityNumber") = Request.Form("txtSocialSecurity")
rs("FirstName") = Request.Form("txtFirstName")
rs("LastName") = Request.Form("txtLastName")
rs("ColorPreference") = Request.Form("txtColorPref")
rs("Password") = Request.Form("txtPassword")
rs("FoodPreference") = Request.Form("txtFoodPref")
rs("FinalUpdate") = CInt(Request.Form("chkFinalUpdate"))
rs.update
Response.Write "<font color = ""teal"">"
Response.Write "Process successful. Your record has been added to our
database."
Response.Write "</font>"

Else
'Dispaly error message
Response.Write "<font color = ""teal"">"
Response.Write "Data exists corresponding to your input social security."
Response.Write "<br>"
Response.Write "Please check your social security number and try again."
Response.Write "</font>"
'set objects to nothing to clear out memory
CN.Close
rs.Close
rs1.Close

set RS= nothing
set rs1= nothing
set conn = nothing
End If

%>




 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      12-14-2004
<normal blurbs here about ADODB.Recordset, ODBC, etc. that you've heard a
thousand times before. :] >

Try bracketing Password as such:

strSQL = "SELECT Main.IDNumber, Main.SocialSecurityNumber, Main.[Password],
Main.FirstName, Main.LastName, Main.ColorPreference, Main.FoodPreference,
Main.FinalUpdate FROM Main where " & _
"SocialSecurityNumber ='" & Request.Form("txtSocialSecurity") & "'"

Ray at home




"Jack" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> strSQL = "SELECT Main.IDNumber, Main.SocialSecurityNumber, Main.Password,
> Main.FirstName, Main.LastName, Main.ColorPreference, Main.FoodPreference,
> Main.FinalUpdate FROM Main where " & _
> "SocialSecurityNumber ='" & Request.Form("txtSocialSecurity") & "'"
> RS.Open strSQL
> 'Response.Write strSQL
>
> 'Check for empty recordset which indicates user information was not found
> If RS.EOF or RS.BOF Then



 
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
It's strange that the address of array elements are not acceptable template-arguments!! Wayne Shu C++ 8 01-29-2007 08:28 PM
type 'slice' is not an acceptable base type Antoon Pardon Python 2 12-21-2005 09:36 AM
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another ERROR SyrUser03 ASP General 2 03-11-2005 04:25 PM
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another Tim Gaunt ASP General 7 12-18-2003 11:59 PM
"Arguments are of the wrong type, out of acceptable range" error J. Muenchbourg ASP General 1 07-25-2003 02:34 PM



Advertisments