|
 |
access_asp thread: Expected 'End' error
Message #1 by "Steven Dinkelaar" <S.dinkelaar@c...> on Tue, 28 Jan 2003 14:25:01
|
|
I just started ASP a few weeks ago, It all started well until I tried to
get this script working. I can't find the error, everytime I try something
diffrent the same error appears.
Can someone please give me some help?
thnx
STeven
error message:
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/SSC/querie2a.asp, line 117
<%@ Language = "VBScript"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
</HEAD>
<BODY bgColor=#eff3fa>
<%
Dim conn ' ADO connection
Dim rs ' ADO recordset
Dim strDBPath ' path to our Access database (*.mdb) file
Dim strSQL ' The SQL Query we build on the fly
Dim strSearch ' The text being looked for
Dim strURL ' The URL of this page so the form will work
dim soort 'type student
dim code 'welke code is ingevuld
dim instituut 'welk instituut is gekozen
Dim iFieldCount, iLoopVar
dim item
strURL = Request.ServerVariables("URL")
' soort student is het een aanmelder of een student.
soort = Request.form("soort_student")
If soort = "aanmelder" Then
soort = 1
Else
soort = 0
End If
' geef de individuele instituten een cijfer ter bevordering van de
selectie.
instituut = Request.form("instituten")
If instituut = "COO" Then
instituut = 1
If instituut = "BED" Then
instituut = 2
If instituut = "BOU" Then
instituut = 3
If instituut = "HEA" Then
instituut = 4
If instituut = "HEV" Then
instituut = 5
If instituut = "HTD" Then
instituut = 6
If instituut = "IDM" Then
instituut = 7
If instituut = "IE" Then
instituut = 8
If instituut = "IMT" Then
instituut = 9
If instituut = "PA" Then
instituut = 10
Else
instituut = 0
End if
' Open de verbinding met de database.
' Daarna word gekeken wat er is geselecteerd om vervolgens de juiste
querie te openen
If strSearch = "soort = 1" & "instituut = 1" Then
set conn = server.createobject("adodb.connection")
conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" &
Server.MapPath("test.mdb")
strSQL = "SELECT * FROM Leeuwenburg_aanmelders_COO_betaald "
Set rs = conn.Execute(strSQL)
%>
<table border="1" cellspacing="0" cellpadding="0" width="700">
<tr>
<td><%= rs.Fields("oms_opleiding").Value %></td>
<td><%= rs.Fields("Omschrijving_oplFase").Value %></td>
<td><%= rs.Fields("Omschrijving_status").Value %></td>
<td><%= rs.Fields("Telefoon").Value %></td>
<td><%= rs.Fields("Datum_aankomst_opleiding").Value %></td>
<td><%= rs.Fields("Achternaam").Value %></td>
<td><%= rs.Fields("voorvoegsels").Value %></td>
<td><%= rs.Fields("voorletters").Value %></td>
<td><%= rs.Fields("Datum_betaald").Value %></td>
<td><%= rs.Fields("kode_instituut").Value %></td>
</tr>
<%
' Herhaal het onderstaande totdat het einde van de recordset is bereikt.
' Zet de waarde van de recordset van alle velden tussen <td></td> tags.
' Bij elke loop word er een rij van de tabel neergezet.
Do While Not rs.EOF
%>
<%
'ga naar het volgende record om de waarde in de nieuwe rij te laten zien.
rs.MoveNext
loop
%>
</table>
<p>
<%
' Close our recordset and connection and dispose of the objects
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
End If
%>
</BODY></HTML>
Message #2 by "Schelling, Michael" <schellim@s...> on Tue, 28 Jan 2003 11:32:25 -0500
|
|
Need to use ElseIf .
If instituut = "COO" Then
instituut = 1
ElseIf instituut = "BED" Then
instituut = 2
ElseIf instituut = "BOU" Then
instituut = 3
Else
soort = 0
End If
Instead of all the IFs you could use a CASE statement.
-----Original Message-----
From: Steven Dinkelaar [mailto:S.dinkelaar@c...]
Sent: Tuesday, January 28, 2003 9:25 AM
To: Access ASP
Subject: [access_asp] Expected 'End' error
I just started ASP a few weeks ago, It all started well until I tried to
get this script working. I can't find the error, everytime I try something
diffrent the same error appears.
Can someone please give me some help?
thnx
STeven
error message:
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/SSC/querie2a.asp, line 117
<%@ Language = "VBScript"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
</HEAD>
<BODY bgColor=#eff3fa>
<%
Dim conn ' ADO connection
Dim rs ' ADO recordset
Dim strDBPath ' path to our Access database (*.mdb) file
Dim strSQL ' The SQL Query we build on the fly
Dim strSearch ' The text being looked for
Dim strURL ' The URL of this page so the form will work
dim soort 'type student
dim code 'welke code is ingevuld
dim instituut 'welk instituut is gekozen
Dim iFieldCount, iLoopVar
dim item
strURL = Request.ServerVariables("URL")
' soort student is het een aanmelder of een student.
soort = Request.form("soort_student")
If soort = "aanmelder" Then
soort = 1
Else
soort = 0
End If
' geef de individuele instituten een cijfer ter bevordering van de
selectie.
instituut = Request.form("instituten")
If instituut = "COO" Then
instituut = 1
If instituut = "BED" Then
instituut = 2
If instituut = "BOU" Then
instituut = 3
If instituut = "HEA" Then
instituut = 4
If instituut = "HEV" Then
instituut = 5
If instituut = "HTD" Then
instituut = 6
If instituut = "IDM" Then
instituut = 7
If instituut = "IE" Then
instituut = 8
If instituut = "IMT" Then
instituut = 9
If instituut = "PA" Then
instituut = 10
Else
instituut = 0
End if
' Open de verbinding met de database.
' Daarna word gekeken wat er is geselecteerd om vervolgens de juiste
querie te openen
If strSearch = "soort = 1" & "instituut = 1" Then
set conn = server.createobject("adodb.connection")
conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" &
Server.MapPath("test.mdb")
strSQL = "SELECT * FROM Leeuwenburg_aanmelders_COO_betaald "
Set rs = conn.Execute(strSQL)
%>
<table border="1" cellspacing="0" cellpadding="0" width="700">
<tr>
<td><%= rs.Fields("oms_opleiding").Value %></td>
<td><%= rs.Fields("Omschrijving_oplFase").Value %></td>
<td><%= rs.Fields("Omschrijving_status").Value %></td>
<td><%= rs.Fields("Telefoon").Value %></td>
<td><%= rs.Fields("Datum_aankomst_opleiding").Value %></td>
<td><%= rs.Fields("Achternaam").Value %></td>
<td><%= rs.Fields("voorvoegsels").Value %></td>
<td><%= rs.Fields("voorletters").Value %></td>
<td><%= rs.Fields("Datum_betaald").Value %></td>
<td><%= rs.Fields("kode_instituut").Value %></td>
</tr>
<%
' Herhaal het onderstaande totdat het einde van de recordset is bereikt.
' Zet de waarde van de recordset van alle velden tussen <td></td> tags.
' Bij elke loop word er een rij van de tabel neergezet.
Do While Not rs.EOF
%>
<%
'ga naar het volgende record om de waarde in de nieuwe rij te laten zien.
rs.MoveNext
loop
%>
</table>
<p>
<%
' Close our recordset and connection and dispose of the objects
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
End If
%>
</BODY></HTML>
Message #3 by "Steven Dinkelaar" <s.dinkelaar@c...> on Tue, 28 Jan 2003 19:37:04
|
|
I did that.
Now I don't have an error statement, Instead I don't have any output at
all. Is the problem in the section where the output is generated or is
there a fault in the reference to the databse?
> Need to use ElseIf .
If instituut = "COO" Then
instituut = 1
ElseIf instituut = "BED" Then
instituut = 2
ElseIf instituut = "BOU" Then
instituut = 3
Else
soort = 0
End If
Instead of all the IFs you could use a CASE statement.
-----Original Message-----
From: Steven Dinkelaar [mailto:S.dinkelaar@c...]
Sent: Tuesday, January 28, 2003 9:25 AM
To: Access ASP
Subject: [access_asp] Expected 'End' error
I just started ASP a few weeks ago, It all started well until I tried to
get this script working. I can't find the error, everytime I try something
diffrent the same error appears.
Can someone please give me some help?
thnx
STeven
error message:
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/SSC/querie2a.asp, line 117
<%@ Language = "VBScript"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
</HEAD>
<BODY bgColor=#eff3fa>
<%
Dim conn ' ADO connection
Dim rs ' ADO recordset
Dim strDBPath ' path to our Access database (*.mdb) file
Dim strSQL ' The SQL Query we build on the fly
Dim strSearch ' The text being looked for
Dim strURL ' The URL of this page so the form will work
dim soort 'type student
dim code 'welke code is ingevuld
dim instituut 'welk instituut is gekozen
Dim iFieldCount, iLoopVar
dim item
strURL = Request.ServerVariables("URL")
' soort student is het een aanmelder of een student.
soort = Request.form("soort_student")
If soort = "aanmelder" Then
soort = 1
Else
soort = 0
End If
' geef de individuele instituten een cijfer ter bevordering van de
selectie.
instituut = Request.form("instituten")
If instituut = "COO" Then
instituut = 1
If instituut = "BED" Then
instituut = 2
If instituut = "BOU" Then
instituut = 3
If instituut = "HEA" Then
instituut = 4
If instituut = "HEV" Then
instituut = 5
If instituut = "HTD" Then
instituut = 6
If instituut = "IDM" Then
instituut = 7
If instituut = "IE" Then
instituut = 8
If instituut = "IMT" Then
instituut = 9
If instituut = "PA" Then
instituut = 10
Else
instituut = 0
End if
' Open de verbinding met de database.
' Daarna word gekeken wat er is geselecteerd om vervolgens de juiste
querie te openen
If strSearch = "soort = 1" & "instituut = 1" Then
set conn = server.createobject("adodb.connection")
conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" &
Server.MapPath("test.mdb")
strSQL = "SELECT * FROM Leeuwenburg_aanmelders_COO_betaald "
Set rs = conn.Execute(strSQL)
%>
<table border="1" cellspacing="0" cellpadding="0" width="700">
<tr>
<td><%= rs.Fields("oms_opleiding").Value %></td>
<td><%= rs.Fields("Omschrijving_oplFase").Value %></td>
<td><%= rs.Fields("Omschrijving_status").Value %></td>
<td><%= rs.Fields("Telefoon").Value %></td>
<td><%= rs.Fields("Datum_aankomst_opleiding").Value %></td>
<td><%= rs.Fields("Achternaam").Value %></td>
<td><%= rs.Fields("voorvoegsels").Value %></td>
<td><%= rs.Fields("voorletters").Value %></td>
<td><%= rs.Fields("Datum_betaald").Value %></td>
<td><%= rs.Fields("kode_instituut").Value %></td>
</tr>
<%
' Herhaal het onderstaande totdat het einde van de recordset is bereikt.
' Zet de waarde van de recordset van alle velden tussen <td></td> tags.
' Bij elke loop word er een rij van de tabel neergezet.
Do While Not rs.EOF
%>
<%
'ga naar het volgende record om de waarde in de nieuwe rij te laten zien.
rs.MoveNext
loop
%>
</table>
<p>
<%
' Close our recordset and connection and dispose of the objects
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
End If
%>
</BODY></HTML>
|
|
 |