Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - error?? what error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

error?? what error

 Post Reply Post Reply
Author
eagle00789 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 24 March 2003
Location: Netherlands
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle00789 Quote  Post ReplyReply Direct Link To This Post Topic: error?? what error
    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 Gravenrode and here and here
Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post 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
Soft 4 web
Back to Top
eagle00789 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 24 March 2003
Location: Netherlands
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle00789 Quote  Post ReplyReply Direct Link To This Post 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 Gravenrode and here and here
Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post 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
Soft 4 web
Back to Top
eagle00789 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 24 March 2003
Location: Netherlands
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle00789 Quote  Post ReplyReply Direct Link To This Post Posted: 09 April 2003 at 7:20am
i checked and there is no typo i could find
Using forum at Gravenrode and here and here
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
eagle00789 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 24 March 2003
Location: Netherlands
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle00789 Quote  Post ReplyReply Direct Link To This Post 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 Gravenrode and here and here
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.