Thanks for the post Mike. I understand what you are speaking of, but that is not my problem, my problem is more simple than that. Basically i have a webpage that is in .aspx format, in the body of my aspx page i am trying to run this code " <!--#include file='dcb/poll.asp' --> " which is an asp command and when i try to run the webpage with this command inserted in the body i get an error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30807: 'Let' and 'Set' assignment statements are no longer supported.
Source Error:
|
Line 45: ' * * * * * * * * * * * Line 46: Dim CN Line 47: Set CN = Server.CreateObject("ADODB.Connection") Line 48: CN.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ Line 49: "Data Source=" & Path & "Poll.mdb" & ";" & _
|
The poll.ap file it is trying to run is this ill show you the code:
<!--#include file='adovbs.inc'-->
<%
' * * * * * * * * * * * *
' * Display Poll Number *
' * * * * * * * * * * * *
Dim Poll
Poll = "2"
' * * * * * * * * * * * * * * * * * * *
' * Database Structure *
' * * * * * * * * * * * * * * * * * * *
'Database: Poll.mdb
'
'Table: tblPoll
'Fields: rcrd_ID (AutoNuMber)(Key)
' Poll_Nr (Text 50)
' Poll_Date (Date)
' Question (Text 255)
' Option1 (Text 50)
' Option2 (Text 50)
' Option3 (Text 50)
' Option4 (Text 50)
' Option5 (Text 50)
' Option6 (Text 50)
'
'Table: tblVote
'Fields: rcrd_ID (AutoNuMber)(Key)
' Poll_Nr (Text 50)
' zDate (Date)
' Vote (Text 1)
' IP (Text 16)
'
' * * * * * * * * * * * * * * * * * * *
' * My five line Path/FileName finder *
' * * * * * * * * * * * * * * * * * * *
Dim Path, A, FileName
Path = Request.ServerVariables("PATH_TRANSLATED")
A = Split(Path, "\")
FileName = A(UBound(A))
Path = left(Path,Len(Path)-Len(FileName))
' * * * * * * * * * * *
' * Open the Database *
' * * * * * * * * * * *
Dim CN
Set CN = Server.CreateObject("ADODB.Connection")
CN.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Path & "Poll.mdb" & ";" & _
"Persist Security Info=False;"
CN.Open
' * * * * * * * * * * * *
' * Open the Recordset *
' * * * * * * * * * * * *
Dim RS, R2, SQL
Set RS = Server.CreateObject("ADODB.Recordset")
Set RS.ActiveConnection = CN
RS.CursorType = adOpenStatic
RS.LockType = adLockOptimistic
Set R2 = Server.CreateObject("ADODB.Recordset")
Set R2.ActiveConnection = CN
R2.CursorType = adOpenStatic
R2.LockType = adLockOptimistic
' * * * * * * * *
' * Record Vote *
' * * * * * * * *
If Len(Request("Option")) > 0 Then
Dim IP, Total, Opt
IP = Request.ServerVariables("REMOTE_ADDR")
If IP <> "127.0.0.1" Then
SQL = "Select * From [tblVote] "
SQL = SQL & "Where [IP] = '" & IP & "' "
SQL = SQL & "And [Poll_Nr] = '" & Poll & "' "
RS.Open SQL
If RS.EOF Then
RS.Close
SQL = "Select * From [tblVote] "
RS.Open SQL
RS.AddNew
RS("Poll_Nr") = Request("Poll_Nr")
RS("zDate") = Date
RS("Vote") = Request("Option")
RS("IP") = IP
RS.Update
End If
Else
SQL = "Select * From [tblVote] "
RS.Open SQL
RS.AddNew
RS("Poll_Nr") = Request("Poll_Nr")
RS("zDate") = Date
RS("Vote") = Request("Option")
RS("IP") = IP
RS.Update
End If
RS.Close
SQL = "Select Count([Vote]) as myCount From [tblVote] "
SQL = SQL & "Where [Poll_Nr] = '" & Request("Poll_Nr") & "' "
R2.Open SQL
Total = R2("myCount")
R2.Close
Response.Write "<div style='border:1px solid black;padding:6px;background-color:#DDF5FF;'>"
SQL = "Select * From [tblPoll] "
SQL = SQL & "Where [Poll_Nr] = '" & Request("Poll_Nr") & "' "
RS.Open SQL
Response.Write RS("Question")
Response.Write "<blockquote>"
Response.Write "<table style='margin:0;border:0;padding:0;'>"
SQL = "Select Count([Vote]) as myCount,[Vote] From [tblVote] "
SQL = SQL & "Where [Poll_Nr] = '" & Request("Poll_Nr") & "' "
If IP <> "127.0.0.1" Then
SQL = SQL & "And [IP] <> '127.0.0.1' "
End If
SQL = SQL & "Group by [Vote] "
R2.Open SQL
Do Until R2.EOF
Opt = "Option" & R2("Vote")
Response.Write "<tr>"
Response.Write " <td>" & RS(Opt) & " </td>"
Response.Write " <td align='right'> " & R2("myCount") & "</td>"
Response.Write " <td align='right'> "
Response.Write FormatPercent((R2("myCount")/Total)) & " </td>"
Response.Write "<tr>"
R2.MoveNext
Loop
Response.Write "</table>"
Response.Write "</blockquote>"
RS.Close
Response.Write "Thank you for voting."
Response.Write "<br><br>"
Response.Write "</div>"
Response.End
End If
SQL = "Select * From [tblPoll]"
SQL = SQL & "Where [Poll_Nr] = '" & Poll & "' "
RS.Open SQL
Response.Write "<div style='border:1px solid black;padding:6px;background-color:#DDF5FF;'>"
Response.Write RS("Question")
Response.Write "<blockquote>"
Response.Write "<form method='post' action='" & FileName & "'>"
Response.Write "<input type='hidden' name='Poll_Nr' value='" & RS("Poll_Nr") & "'>"
Response.Write "<label for='Option1'>"
Response.Write "<input type='radio' name='Option' value='1' ID='Option1'>" & RS("Option1")
Response.Write "</label>"
Response.Write "<br>"
Response.Write "<label for='Option2'>"
Response.Write "<input type='radio' name='Option' value='2' ID='Option2'>" & RS("Option2")
Response.Write "</label>"
Response.Write "<br>"
If Len(RS("Option3")) > 0 Then
Response.Write "<label for='Option3'>"
Response.Write "<input type='radio' name='Option' value='3' ID='Option3'>" & RS("Option3")
Response.Write "</label>"
Response.Write "<br>"
End If
If Len(RS("Option4")) > 0 Then
Response.Write "<label for='Option4'>"
Response.Write "<input type='radio' name='Option' value='4' ID='Option4'>" & RS("Option4")
Response.Write "</label>"
Response.Write "<br>"
End If
If Len(RS("Option5")) > 0 Then
Response.Write "<label for='Option5'>"
Response.Write "<input type='radio' name='Option' value='5' ID='Option5'>" & RS("Option5")
Response.Write "</label>"
Response.Write "<br>"
End If
If Len(RS("Option6")) > 0 Then
Response.Write "<label for='Option6'>"
Response.Write "<input type='radio' name='Option' value='6' ID='Option6'>" & RS("Option6")
Response.Write "</label>"
Response.Write "<br>"
End If
Response.Write "</blockquote>"
Response.Write "<input type='submit' value=' Vote '>"
Response.Write "</form>"
Response.Write "</div>"
%>
Am i totally out of luck to get this working with my .apsx page? Is there not another way to call upon my poll.asp?