|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi...
I downloaded the files to the An Article Rating System With ASP http://www.devarticles.com/printpage.php?articleId=141 Well I set it up almost to the tee but I am getting an error on my showques.asp page.((chaged the page name)..I am including the files i recreated in hopes that one of you can help... Some background on my misery..... I start it with an access database but i transfer the file to sql....on the tutorial it created a connection to the database which i was using until i transfer the database and put my connection. I get an error on line 43 wend.....I dont know what can be causing that error.... Last edited by laridev : December 27th, 2002 at 10:42 PM. |
|
#2
|
|||
|
|||
|
Here is the file......
|
|
#3
|
|||
|
|||
|
Can you tell us what the error was (including the error type and the error code). That will help us in determining the problem.
Also, you might want to type the error code into the search engine on aspfaq.com and see if the answer helps solve your problem. Last edited by aspnewbie : December 28th, 2002 at 10:04 AM. |
|
#4
|
|||
|
|||
|
The error I get in that line....
is as follow error line 43....wend this is the code <% rs.MoveNext wend function ShowRating(quesId) const MIN_RATINGS_BEFORE_SHOW = 3 i tried addding another %> to close the wend but when i do that and i run the script it tells me i get an error on line 46 which is the funstion ShowRating(quesId) I also have been searching for an answer myself to no avail! |
|
#5
|
|||
|
|||
|
Don't you get a microsoft generated error when you run the script? with the error code?
like: Code:
Microsoft VBScript runtime (0x800A000D) Type Mismatch: <variable> Last edited by aspnewbie : December 28th, 2002 at 10:13 AM. |
|
#6
|
|||
|
|||
|
Yes it did unfortunately...I am at home (first time in a long time due to this prob) and only wrote down the lines where i was getting the error and what they said....
|
|
#7
|
|||
|
|||
|
Too bad, cause that would provide more info! I don't have SQL server at home, so I can't reproduce the error.
You didn't get it though when you used Access right? |
|
#8
|
|||
|
|||
|
okay, I found a couple of problems looking at the code and your database.
First your summary field is not currency, so you should remove the reference to formatcurrency in the following: <b>Category:</b> <%=FormatCurrency(rs.Fields(4).Value, 2)%> Second, numbering starts from 0 so to call the category field you should have rs.Fields(2). Summary is rs.Fields(3). You don't have a fifth field, so you can't use (rsfields(4).value). So it should read <b>Question:</b> <%=rs.Fields(1).Value%><br> <b>Summary:</b> <%=rs.Fields(3).Value%><br> <b>Category:</b> <%=rs.Fields(2).Value%> also you remove the %> after the statement as it is not needed there. Code:
rs.Open strSQL,conn,adOpenForwardOnly,adLockReadOnly %> Hope this helps. Let me know if you have any other errors. |
|
#9
|
|||
|
|||
|
Hi added the changes you suggested now I am getting this error... on my shoques.asp page....
HTTP 500.100 - Internal Server Error - ASP error Internet Information Services -------------------------------------------------------------------------------- Technical Information (for support personnel) Error Type: ADODB.Recordset (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /execstaff/poll2003/showques.asp, line 12 Browser Type: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705) Page: GET /execstaff/poll2003/showques.asp Time: Monday, December 30, 2002, 9:08:26 AM on the rate asp I get the following one.. Error Type: Microsoft VBScript compilation (0x800A0401) Expected end of statement /execstaff/poll2003/rate.asp, line 21, column 21 Browser Type: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705) Page: GET /execstaff/poll2003/rate.asp any advice? |
|
#10
|
|||
|
|||
|
Can you post the revised files? I was able to get it to work at home, but I'm not at home now. Thanks.
|
|
#11
|
|||
|
|||
|
here they go..
|
|
#12
|
|||
|
|||
|
Okay, instead of this:
Code:
strConnect = "PROVIDER=SQLOLEDB;UID=sa;PWD=gilgamesh; Data Source=mhsnet_sql;Initial Catalog=Intranet;" conn.Open strConnect rs.CursorLocation = adUseClient Do this: Code:
Conn.ConnectionString = "PROVIDER=SQLOLEDB;UID=sa;PWD=gilgamesh;Data Source=mhsnet_sql;Initial Catalog=Intranet;" Conn.Open |
|
#13
|
|||
|
|||
|
line 8 of showques.asp you have strSQL = with no statement. So you're getting an error when you attempt to open the recordset.
You probably want a select statement in there? |
|
#14
|
|||
|
|||
|
Instead of
Code:
strsql="SELECT * FROM question ORDER BY question ASC" rs.Open strSQL,conn,adOpenForwardOnly,adLockReadOnly try Code:
strSQL = "SELECT * FROM question ORDER BY question ASC" set rs = Conn.Execute(strSQL) |
|
#15
|
|||
|
|||
|
Error Type:
Microsoft VBScript compilation (0x800A0409) Unterminated string constant /execstaff/poll2003/showques.asp, line 6, column 68 The code so far with your suggestions up to line 23 <% dim conn, rs, strSQL, strConnect, action action = Request.QueryString("action") set conn = Server.CreateObject("ADODB.Connection") set rs = Server.CreateObject("ADODB.Recordset") Conn.ConnectionString = "PROVIDER=SQLOLEDB;UID=sa;PWD=gilgamesh;Data Source=mhsnet_sql;Initial Catalog=Intranet;" Conn.Open strSQL = "SELECT * FROM question ORDER BY question ASC" set rs = Conn.Execute(strSQL) while not rs.EOF %> <font face="Verdana" size="2" color="black"> <h2><%=rs.Fields(1).Value%></h2> Rated: <%=ShowRating(rs.Fields(0).Value)%><br><br> <b>Question:</b> <%=rs.Fields(1).Value%><br> <b>Summary:</b> <%=rs.Fields(3).Value%><br> <b>Category:</b> <%=rs.Fields(2).Value%><br> </font> <br> |
|
#16
|
|||
|
|||
|
Remove the hard return between data and source, so it falls on one line.
also, you don't need the variable strConnect anymore. |
|
#17
|
|||
|
|||
|
My new error... Error Type: Microsoft VBScript compilation (0x800A03EA) Syntax error /execstaff/poll2003/showques.asp, line 61, column 3 Browser Type: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705) Page: GET /execstaff/poll2003/showques.asp Time: Monday, December 30, 2002, 10:44:20 AM More information: |