473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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

%>


Jul 22 '05 #1
1 2884
<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" <Ja**@discussions.microsoft.com> wrote in message
news:6B**********************************@microsof t.com...

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

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: J. Muenchbourg | last post by:
I'm getting an "Arguments are of the wrong type, out of acceptable range, in conflicts with each other " error , pointing to the sql statement in this block: Dim rstime Set rstime =...
7
by: Tim Gaunt | last post by:
Hi, I'm hoping that someone will be able to help me with this one, I'm developing an application which basically inserts a load of data into the database ready for validation at a later date, I...
15
by: Erica | last post by:
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. /shop/results.asp, line...
8
by: the other john | last post by:
Here's my project info first... DB: Access 2000 server: IIS 2003 Here is the error I'm getting... ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable...
0
by: Edward | last post by:
I have a wrapper function for executing a SQL Server Stored Procedure that returns no records: Public Function modRunStoredProc(vstrSPName As String, ParamArray vvarParams() As Variant) As...
1
by: iam247 | last post by:
Hi I have a web page which receives information from a form (using request.form) and also attempts to look at an Access query to read in recoeds to a variable named rsGroup. When I have the...
12
by: anantraoneel | last post by:
Hi Friend My project is a Library System. In Project is Book Master form. If I've select Book Type from Type Master and Publication from Publication Master then this error has come: "Arguments...
1
by: thecubemonkey | last post by:
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....
6
by: gforgourav | last post by:
'Arguments are of wrong type, are out of acceptable range, or are in conflict with one another' this error occurs ... i m using vb.net 2005 with sql server 2000 backend i had a project in vb 6.0...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.