ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 27th, 2002, 10:35 PM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Need Help Badly on script-HELP ASP GUROS!

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.

Reply With Quote
  #2  
Old December 27th, 2002, 10:43 PM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here is the file......
Attached Files
File Type: zip poll2003.zip (15.3 KB, 271 views)

Reply With Quote
  #3  
Old December 28th, 2002, 09:39 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
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.

Reply With Quote
  #4  
Old December 28th, 2002, 10:06 AM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!

Reply With Quote
  #5  
Old December 28th, 2002, 10:10 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
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.

Reply With Quote
  #6  
Old December 28th, 2002, 10:17 AM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

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

Reply With Quote
  #7  
Old December 28th, 2002, 10:19 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
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?

Reply With Quote
  #8  
Old December 28th, 2002, 12:00 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
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.

Reply With Quote
  #9  
Old December 30th, 2002, 08:08 AM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

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?

Reply With Quote
  #10  
Old December 30th, 2002, 08:09 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
Can you post the revised files? I was able to get it to work at home, but I'm not at home now. Thanks.

Reply With Quote
  #11  
Old December 30th, 2002, 08:16 AM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
here they go..
Attached Files
File Type: zip poll2003.zip (15.2 KB, 259 views)

Reply With Quote
  #12  
Old December 30th, 2002, 08:24 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
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

Reply With Quote
  #13  
Old December 30th, 2002, 08:28 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
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?

Reply With Quote
  #14  
Old December 30th, 2002, 08:30 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
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)

Reply With Quote
  #15  
Old December 30th, 2002, 08:36 AM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>

Reply With Quote
  #16  
Old December 30th, 2002, 08:42 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
Remove the hard return between data and source, so it falls on one line.

also, you don't need the variable strConnect anymore.

Reply With Quote
  #17  
Old December 30th, 2002, 09:43 AM
laridev laridev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Miami
Posts: 29 laridev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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: