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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP - ADO Problem 1

Status
Not open for further replies.

scottdaohio

IS-IT--Management
Oct 28, 2000
1
US
Any help anyone can provide for this error, would be GREATLY appreciated. Below is the code I am using on a data entry form, to enter data into a SQL Server database, off of an ASP page. I have created an ODBC System DSN connection named "WEB." The SQL Server has a table named "tblApplicant", with a username of "sa" and a password of "Password." The problem I am getting, points to the objRS.Open line, where I get the following error:

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

My question is, what am I doing wrong???????

<%@ Language=VBScript %>
<!--METADAT TYPE=&quot;typelib&quot; FILE = &quot;D:\Program Files\Common Files\System\ADO&quot;-->
<%
Dim objConn
Dim objRS

Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set objRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)

objConn.Open &quot;DSN=Web&quot;,&quot;sa&quot;,&quot;password&quot;
objRS.Open &quot;tblApplicant&quot;, objConn, adOpenStatic, adLockOptimistic <-- Error?????
objRS.AddNew
.......
%>


Any help you can provide, would be most appreciated. Thanks!!!
 
I noticed you are using constants like &quot;adOpenStatic&quot; and &quot;adLockOptimistic&quot;. Did you remember to include your adovbs.inc file? If not, those constants are unknown, and therefore become unacceptable arguments.



Choo Khor
choo.khor@intelebill.com
 
This line below is incorrect:

[tt]<!--METADAT TYPE=&quot;typelib&quot; FILE = &quot;D:\Program Files\Common Files\System\ADO&quot;-->[/tt]

You need to change it to read as follows:

[tt]<!--METADATA TYPE=&quot;typelib&quot; FILE=&quot;D:\Program Files\Common Files\System\ADO\MSADO15.dll&quot;-->[/tt]

Don't include the file 'adovbs.inc' as suggested by khorjak, as the METADATA is the recommended procedure, otherwise your ASP files will end up being way too big for what you need (adovbs.inc is 10KB in size).

Just to be certain, double check the location of your Common Files folder, as you have it set to your 'D:' drive, maybe it's actually on your 'C:' drive.


ahdkaw
ahdkaw@ots.zzn.com
'If anythign can go wrong, it will'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top