Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

poll script quesiton

Status
Not open for further replies.

runsh

Technical User
Dec 19, 2004
16
US
anyone knows how to display poll results in the same page as voting page. this is in Asp runing with access databse.

I tried to use included file <!-- #INCLUDE FILE="stats.asp" -->
but I get error.

any suggestions.
thanks
 
This is the error:

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/awgal/vote/Stats.asp, line 36
sub carryOn

line 36 is in red

Code:
Set Myconn = Server.CreateObject("ADODB.Connection")
	Myconn.Open DB_CONNECTIONSTRING
	

	
	SET MYTABLE= SERVER.CREATEOBJECT("ADODB.RECORDSET")
	SET MYTABLE2= SERVER.CREATEOBJECT("ADODB.RECORDSET")

		mySQL2 = "select * from Voting  "
	mytable2.open mysql2,myconn,3,3
	
	mySQL = "select * from Votes WHERE PicID = " & yPicID & " ;"
	
		mytable.open mysql,myconn,3,3
	
	if mytable.recordcount = 0 then call yErrorZero else Call CarryOn
	
	
	
[COLOR=red]	sub carryOn [/color]
	
	Tvotes = 0
	
	do while not mytable2.eof
	
		fname = mytable2.fields("fieldname")
yfieldname = fname
		yFieldName =  replace(yFieldName," ","_")
	yFieldName =  replace(yFieldName,"*","")
	yFieldName =  replace(yFieldName,"!","")
	yFieldName =  replace(yFieldName,"""","")
	yFieldName =  replace(yFieldName,"£","")
	yFieldName =  replace(yFieldName,"$","")
	yFieldName =  replace(yFieldName,"%","")
	yFieldName =  replace(yFieldName,"^","")
	yFieldName =  replace(yFieldName,"&","")
yFieldName =  replace(yFieldName,"(","")
yFieldName =  replace(yFieldName,")","")
yFieldName =  replace(yFieldName,"_","")
yFieldName =  replace(yFieldName,"-","")
yFieldName =  replace(yFieldName,"=","")
yFieldName =  replace(yFieldName,"+","")
yFieldName =  replace(yFieldName,"#","")
yFieldName =  replace(yFieldName,"~","")
yFieldName =  replace(yFieldName,"[","")
yFieldName =  replace(yFieldName,"{","")
yFieldName =  replace(yFieldName,"]","")
yFieldName =  replace(yFieldName,"}","")
yFieldName =  replace(yFieldName,";","")
yFieldName =  replace(yFieldName,":","")
yFieldName =  replace(yFieldName,"@","")
yFieldName =  replace(yFieldName,"'","")
yFieldName =  replace(yFieldName,"<","")
yFieldName =  replace(yFieldName,",","")
yFieldName =  replace(yFieldName,">","")
yFieldName =  replace(yFieldName,".","")
yFieldName =  replace(yFieldName,"?","")
yFieldName =  replace(yFieldName,"/","")
yFieldName =  replace(yFieldName,"\","")
yFieldName =  replace(yFieldName,"|","")
yFieldName =  replace(yFieldName,"¬","")
yFieldName =  replace(yFieldName,"`","")


	
	yfield = eval("mytable.fields(""" & yfieldname & """)" & VBcrlf)
	
	
	Tvotes = Tvotes + yfield
	
	mytable2.movenext
	loop
	%>
 
I don't know much asp

no end sub.
Chris.
what that means. should I add end if after
sub carryOn ??

thanks
 
a subroutine has to have a line that indicates the end of the subroutine

Code:
    mytable2.movenext
    loop
[red]end sub[/red]
    %>


Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top