View Single Post
Old 27-Feb-2007, 09:11 PM   #1 (permalink)
Sangeetha
Fixed Error!
 
Sangeetha's Avatar

Posts: 139
Location: Chennai
Join Date: Feb 2007
Rep Power: 2 Sangeetha is on a distinguished road

IM:
Default Arguments are of the wrong type, are out of acceptable range, or are in conflict with

Question: In the following ASP page, I can open a recordset without any parameters (rsRep)
but when I try opening one (rsSurgery) using parameters:

rsSurgery.Open strSQL, Session("conn"), adOpenDynamic, adLockOptimistic, adCmdTableDirect

it breaks, giving the error:
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

adOpenDynamic, adLockOptimistic, adCmdTableDirect
should open an editable recordset, such that AddNew will work.
(I don't even have the AddNew in there yet!!!)
Thanks!
************************************************** **

<html>
<head>
<title>Add a Surgery</title>
</head>
<body>
<table border=1>
<tr>
<td font size="4">Add a Surgery</td>
</tr>

<%

Set rsSurgery = Server.CreateObject("ADODB.Recordset")
Set rsRep = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT [ARA_RepKey] FROM [ARA_RepHeader] WHERE [ARA_RepName] = '"
strSQL = strSQL & Request.Form("cboRepName") & "'"

rsRep.Open strSQL, Session("conn")
Response.Write(rsRep("ARA_RepKey")) ' <---- this works, proving that Session("conn")
' is connected to the database

strSQL = "SELECT [AKA_SurgeryDate] FROM [AKA_CaseHeader]"

rsSurgery.Open strSQL, Session("conn"), adOpenDynamic, adLockOptimistic, adCmdTableDirect

rsRep.Close
rsSurgery.Close


%>
<tr>
<td>done</td>
</tr>
</table>

</body>
</html>
Sangeetha is offline   Reply With Quote