Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB Recordset error

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
Hi ASP gurus -

This is the error I get in my ASP page:

"ADODB.Recordset error '800a0bb9'
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. "

It happens at the .Open statement


Set rsReqs = Server.CreateObject("ADODB.Recordset")

The error occurs at this statement....
rsReqs.Open "SystemsAccessReqs", conn, adOpenForwardOnly, adLockOptimistic, adCmdTable

Can anyone see a problem? (I perform the logon and connection in another ASP doc... before this one runs)
I think the connection is working ok.

Thanks, John


 
when I've had that type of error b4, it references the conn string even tho the error is actually in your select statement...I'd start by reviewing your select and verify spelling, columns are actually in the table you're using, not trying to put numbers into text fields etc....stuff like that...just out of curiousity, is it an insert?
hth
mark
 
To hithere - u r correct... This is only for Adds (inserts) so that is why I didn't specify an SQL stmt....

do I need 1 anyway?

u gave me a good hint. I'll experiment with that tomorrow.
Thanks, John
 
If the statement is only an INSERT, then you don't want to use a recordset... consider this:

dim sql
sql = "INSERT INTO tableName (colName) VALUES (value)"
connection.execute sql

It's one of the big misconceptions that a recordset is needed for all operations in ASP -- update, delete, insert, and select. When in truth, you really only need one for SELECT when you actually want to display something to the user.

There is the occasional instance where you MIGHT want to use one for UPDATE. For instance, you can set a pessimistic lock on a dataSet if you need to update it, and don't want anyone else to get a dirty read on the data while you are in the middle of that update. There's a FAQ in the FAQ section of this forum that goes into alot of detail on the properties of a recordset if you have any questions about the pessimistic lock or others. Makes a good read.

good luck! :)
Paul Prewett
penny.gif
penny.gif
 
OK guys - I have consolidated my little ASPs into 1 so that we can see the complete picture....I'm doing something wrong
obviously:

my server name is SQL_Server
database is IS
Table is ISSystemsAccessReqs

Thanks for your time, John


<%

Dim objLogon
Dim conn
Dim rsReqs

Set objLogon = Server.CreateObject(&quot;Impersonate.ImpersonateUser&quot;)

objLogon.Logon &quot;iusr_apps_server2&quot;, &quot;threepeaks&quot;, &quot;Springfield&quot;

if isobject(session(&quot;IS_conn&quot;)) then
set conn = session(&quot;IS_conn&quot;)
else
set conn = server.createobject(&quot;adodb.connection&quot;)
conn.open &quot;Provider=SQLOLEDB.1;Integrated Security=SSPI;&quot; & _
&quot;Persist Security Info=False;Initial Catalog=IS;&quot; & _
&quot;Data Source=SQL_SERVER&quot;
set session(&quot;IS_conn&quot;) = conn
end if

Set rsReqs = Server.CreateObject(&quot;ADODB.Recordset&quot;)

'*** fails at this Open stmt
ADODB.Recordset error '800a0bb9'
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
******************************************************

rsReqs.Open &quot;SystemsAccessReqs&quot;, conn, adOpenForwardOnly, adLockOptimistic, adCmdTable

rsReqs.AddNew

rsReqs(&quot;UserNameF&quot;) = Request.Form(&quot;NameFirst&quot;)
rsReqs(&quot;UserNameL&quot;) = Request.Form(&quot;NameLast&quot;)
rsReqs(&quot;UserNameMI&quot;) = Request.Form(&quot;NameMI&quot;)
rsReqs.Update

%>
 
Thank you Paul,

I used your suggestion....
dim sql
sql = &quot;INSERT INTO tableName (colName) VALUES (value)&quot;
connection.execute sql

Worked like a charm!

I appreciate the help from you and hithere.
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top