|
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
|