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 Chriss 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 (0x800A0BB9) ERROR

Status
Not open for further replies.

webgs

Programmer
Joined
Oct 30, 2001
Messages
59
Location
US
I get the standard "ADODB.Recordset (0x800A0BB9)Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another." When I run the following code:
=========================================================
<%
set conn=server.createobject(&quot;ADODB.Connection&quot;)
conn.open &quot;DSN=mytui_test;UID=sa;Password=&quot;

Dim objRec ' recordset object

' create the recordset object
Set objRec = Server.CreateObject (&quot;ADODB.Recordset&quot;)

' now open it
objRec.Open &quot;DidYouKnow&quot;, strConnect, adOpenForwardOnly, adLockReadOnly, adCmdTable

' add the new records
objRec.Addnew
objRec(&quot;Title&quot;) = &quot;Interesting title 1&quot;
objRec(&quot;Fact&quot;) = &quot;Interesting fact 1&quot;
objRec.Addnew

' now find the records
objRec.Find &quot;Title = 'Interesting title 1'&quot;
objRec.Find &quot;Fact = 'Interesting fact 1'&quot;
If objRec.EOF Then
Response.Write &quot;Record not found&quot;
Else
Response.Write &quot;Successfully found 'Title' <br>&quot;
Response.Write &quot;Successfully found '&quot; & objRec(&quot;Fact&quot;) & &quot;'&quot;
End If

' now close and clean up
objRec.Close
Set objRec = Nothing
%>
========================================================
&quot;DidYouKnow&quot; is a table in the &quot;mytui_test&quot; SQL DB.

Any ideas?
 
Have you assigned values to the parameters?

Code:
adOpenForwardOnly = 0
adLockReadOnly = 1
adCmdTable =2

Since you have created a connection object, why not use that for the connection parameter instead of a string?

Also the cursor type and lock type are the default values so you do not need to supply them; the ADODB component can figure out the data source so that can be omitted too.

Thus -

Code:
objRec.Open &quot;DidYouKnow&quot;, conn

 
Maybe I'm misreading something, but...

You can't open a recordset ReadOnly, then do a .AddNew.
 

Also, the second objRec.AddNew should be objRec.Update. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top