Print Page | Close Window

error?? what error

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1708
Printed Date: 28 March 2026 at 11:14pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: error?? what error
Posted By: eagle00789
Subject: error?? what error
Date Posted: 09 April 2003 at 3:22am

ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/test/rate.asp, line 41

is the error i get. but there is nothing wrong i think.
below are the 2 files i'm using. this is for a rating-system i'm working on.

----- rate.asp -----

<%
response.buffer=true

Dim DataConn, cmdDC, rsDC
Dim Item
Dim iFieldCount, iLoopVar, iLoopVar1
Dim strLTorGT, iCriteria, strSortBy, strOrder
Dim sRequestIP

RatingIDs=Request.QueryString("RatingID")
Rating=Request.QueryString("Rating")

' Get request information
sRequestIP=Request.ServerVariables("REMOTE_ADDR")

' Set general variables
FoundRecordCount=0
sDataSource = "c:\inetpub\wwwroot\test\rating.mdb"
'sDataSource = "d:\Desktop\webpagina gravenrode\Downloads\download.mdb" ' Local Path to Database
BackgroundColor="FFFFFF"
RecordFound=0

' Create and establish data connection
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = 15
DataConn.CommandTimeout = 30

'Access connection code
DataConn.Open "DBQ=" & sDataSource & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password"


' Create and link command object to data connection then set attributes and SQL query
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConn
cmdDC.CommandText = "SELECT * FROM Rating WHERE (RatingID = " & RatingIDs & ")"
'cmdDC.CommandType = 1

' Create recordset
Set rsDC = Server.CreateObject("ADODB.Recordset")
' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)
rsDC.Open cmdDC, , 1, 0
%>
<%
rsDC.Fields("Rating") = rsDC.Fields("Rating") + Rating
rsDC.Fields("Votes") = rsDC.Fields("Votes") + 1
Response.write ("Your rating has been placed")
%>

<%
' Close Data Access Objects
rsDC.Close
Set rsDC = Nothing
Set cmdDC = Nothing
DataConn.Close
Set DataConn = Nothing
%>

----- end rate.asp -----

----- rating.asp -----

<%

Dim DataConn, cmdDC, rsDC
Dim Item
Dim iFieldCount, iLoopVar, iLoopVar1
Dim strLTorGT, iCriteria, strSortBy, strOrder
Dim sRequestIP

RatingID=Request.QueryString("RatingID")

' Get request information
sRequestIP=Request.ServerVariables("REMOTE_ADDR")

' Set general variables
FoundRecordCount=0
sDataSource = "c:\inetpub\wwwroot\test\rating.mdb"
'sDataSource = "d:\Desktop\webpagina gravenrode\Downloads\download.mdb" ' Local Path to Database
BackgroundColor="FFFFFF"
RecordFound=0

' Create and establish data connection
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = 15
DataConn.CommandTimeout = 30

'Access connection code
DataConn.Open "DBQ=" & sDataSource & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password"


' Create and link command object to data connection then set attributes and SQL query
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConn
cmdDC.CommandText = "SELECT * FROM Rating WHERE (RatingID = " & RatingID & ")"
'cmdDC.CommandType = 1

' Create recordset
Set rsDC = Server.CreateObject("ADODB.Recordset")
' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)
rsDC.Open cmdDC, , 1, 1
%>
<%
Rating = rsDC.Fields("Rating")
Votes = rsDC.Fields("Votes")
Rate = Rating / Votes
%>
<form method="POST" name="Rate" action="rate.asp"><img src="Images\<% = Rate %>_star_rating.gif"> (<% = Votes %> votes)
<select name="Rating">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select><input type="submit" value="Verzenden" name="Rate It!">
<input type="hidden" value="<%=RatingID%>" name="RatingID">
</form>

<%
' Close Data Access Objects
rsDC.Close
Set rsDC = Nothing
Set cmdDC = Nothing
DataConn.Close
Set DataConn = Nothing
%>

----- end rating.asp -----



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here



Replies:
Posted By: zaboss
Date Posted: 09 April 2003 at 3:35am

In that line you have an extra s.

cmdDC.CommandText = "SELECT * FROM Rating WHERE (RatingID = " & RatingIDs & ")"

If you delete it, maybe, you know, it will work! Cheers.



-------------
Cristian Banu
http://www.soft4web.ro - Soft 4 web


Posted By: eagle00789
Date Posted: 09 April 2003 at 3:40am
no. that s just has to be there. just look a few lines higer. there it is to. in the request line

-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here


Posted By: zaboss
Date Posted: 09 April 2003 at 5:00am
Well, indeed. Anyway, this error is usualy triggered by a typo or wrong syntax, so you should check it thoroughly. Also, you should check the type of data that you pull in the recordset. An incompatibility here might also trigger this error.

-------------
Cristian Banu
http://www.soft4web.ro - Soft 4 web


Posted By: eagle00789
Date Posted: 09 April 2003 at 7:20am
i checked and there is no typo i could find

-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here


Posted By: pmormr
Date Posted: 09 April 2003 at 6:23pm

what about...

' Create recordset
Set rsDC = Server.CreateObject("ADODB.Recordset")
' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)

rsDC.Open cmdDC, , 1, 0

%>
<%


the extra comma. try "rsDC.open cmdDC, 1, 0"

Hope i helped,

Paul Morgan
Webmaster



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: eagle00789
Date Posted: 10 April 2003 at 8:23am

i just found the real problems. below is the correct code for both files.

thanks for all the help you gave me

----- rate.asp -----

<%
response.buffer=true

Dim DataConn, cmdDC, rsDC
Dim Item
Dim iFieldCount, iLoopVar, iLoopVar1
Dim strLTorGT, iCriteria, strSortBy, strOrder
Dim sRequestIP

RatingID=CInt(Request.Form("RatingID"))
Rating=Request.Form("Rating")

' Get request information
sRequestIP=Request.ServerVariables("REMOTE_ADDR")

' Set general variables
FoundRecordCount=0
'sDataSource = "c:\inetpub\wwwroot\test\rating.mdb"
sDataSource = "d:\Desktop\webpagina gravenrode\test\rating.mdb" ' Local Path to Database
BackgroundColor="FFFFFF"
RecordFound=0

' Create and establish data connection
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = 15
DataConn.CommandTimeout = 30

'Access connection code
DataConn.Open "DBQ=" & sDataSource & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password"


' Create and link command object to data connection then set attributes and SQL query
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConn
cmdDC.CommandText = "SELECT * FROM Rating WHERE RatingID=" & RatingID & ";"
cmdDC.CommandType = 1

' Create recordset
Set rsDC = Server.CreateObject("ADODB.Recordset")
' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)
rsDC.Open cmdDC, , 1, 2, &H0001
%>
<%
rsDC.MoveFirst
rsDC.Fields("Rating").Value = rsDC.Fields("Rating").Value + Rating
rsDC.Fields("Votes").Value = rsDC.Fields("Votes").Value + 1
Response.write ("Your rating has been placed")
rsDC.Update
%>

<%
' Close Data Access Objects
rsDC.Close
Set rsDC = Nothing
Set cmdDC = Nothing
DataConn.Close
Set DataConn = Nothing
%>

----- end rate.asp -----

----- rating.asp -----

<%

Dim DataConn, cmdDC, rsDC
Dim Item
Dim iFieldCount, iLoopVar, iLoopVar1
Dim strLTorGT, iCriteria, strSortBy, strOrder
Dim sRequestIP

RatingID=Request.QueryString("RatingID")

' Get request information
sRequestIP=Request.ServerVariables("REMOTE_ADDR")

' Set general variables
FoundRecordCount=0
'sDataSource = "c:\inetpub\wwwroot\test\rating.mdb"
sDataSource = "d:\Desktop\webpagina gravenrode\test\rating.mdb" ' Local Path to Database
BackgroundColor="FFFFFF"
RecordFound=0

' Create and establish data connection
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = 15
DataConn.CommandTimeout = 30

'Access connection code
DataConn.Open "DBQ=" & sDataSource & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password"


' Create and link command object to data connection then set attributes and SQL query
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConn
cmdDC.CommandText = "SELECT * FROM Rating WHERE (RatingID = " & RatingID & ")"
'cmdDC.CommandType = 1

' Create recordset
Set rsDC = Server.CreateObject("ADODB.Recordset")
' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)
rsDC.Open cmdDC, , 1, 1
%>
<%
Rating = rsDC.Fields("Rating")
Votes = rsDC.Fields("Votes")
Rate = Rating / Votes
Rate = Round(Rate)
%>
<form method="POST" name="Rate" action="rate.asp"><img src="Images\<% = Rate %>_star_rating.gif"> (<% = Votes %> votes)
<select name="Rating">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select><input type="submit" value="Verzenden" name="Rate It!">
<input type="hidden" value="<%=RatingID%>" name="RatingID">
</form>

<%
' Close Data Access Objects
rsDC.Close
Set rsDC = Nothing
Set cmdDC = Nothing
DataConn.Close
Set DataConn = Nothing
%>

----- end rating.asp -----



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net