Print Page | Close Window

Help

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=531
Printed Date: 29 March 2026 at 2:53pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Help
Posted By: donnytree
Subject: Help
Date Posted: 26 February 2003 at 6:34am

I keep getting a HTTP 500 message, and nothing I do to that line will make it go away.

It is this

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/doncaster/teams/default.asp, line 18

adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" Server.MapPath("/doncaster/db/team.mdb")

(I am hosted on brinkster BTW.)

http://www33.brinkster.com/doncaster/teams/default.asp - http://www33.brinkster.com/doncaster/teams/default.asp

I keep trying to alter the line, but nothing works.




Replies:
Posted By: Bunce
Date Posted: 26 February 2003 at 6:40am
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/doncaster/db/team.mdb")

-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: donnytree
Date Posted: 26 February 2003 at 6:48am
Still comes up with the http 500 error. (I'm at college at the moment and cannot get rid of the friendly http message option)


Posted By: Bunce
Date Posted: 26 February 2003 at 7:14am
Tools -> Internet Options -> Advanced -> Turn off Friendly HTTP errors

-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: skyworld
Date Posted: 26 February 2003 at 7:54am

dim dbloc

dbloc = "doncaster/db/team.mdb"

adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(dbloc)

 

 

trythat



Posted By: skyworld
Date Posted: 26 February 2003 at 7:56am

looks like ur prob is here...

 

Microsoft VBScript compilation error '800a03ee'

Expected ')'

/doncaster/teams/default.asp, line 29

Response.Write ("<table border='1' bordercolor='black' cellpadding='0'>"
------------------------------------------------------------------------^
 
u forgot to close the )
Response.Write ("<table border='1' bordercolor='black' cellpadding='0'>")
------------------------------------------------------------------------^


Posted By: donnytree
Date Posted: 26 February 2003 at 9:51am

Now I'm at home, i've sorted it guys, just get this one now...

ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.
doncaster/teams/default.asp, line 38

<html>
<head>
<title>RL Teams</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
'Dimension Variables
Dim adoCon
Dim rsTeam
Dim strSQL

'Create ADO Conn Obj
Set adoCon = Server.CreateObject("ADODB.Connection")

'DNS-Less Connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.MapPath("/doncaster/db/team.mdb")

'Create ADO Recordset
Set rsTeam = Server.CreateObject("ADODB.Recordset")

'Initialise strSQL variable
strSQL = "SELECT team.* FROM team;"

'Open Recordset
rsTeam.Open strSQL, adoCon

Response.Write ("<table border='1' bordercolor='black' cellpadding='0'>")

'Loop recordset
Do While not rsTeam.EOF

'Write the HTML
Response.Write ("<tr>")
Response.Write ("<td>")
Line 37 - Response.Write ("<a href=""view_team.asp?Id_No=" & rsTeam("Id_No") & """>")
Response.Write (rsTeam("Name"))
Response.Write ("</a>")     
Response.Write ("</td>")
Response.Write ("</tr>")
Response.Write ("<tr>")
Response.Write ("<td>")
Response.Write (rsTeam("League"))
Response.Write ("</td>")
Response.Write ("</tr>")

rsTeam.MoveNext

Loop

'Reset server variables
rsTeam.Close
Set rsTeam = Nothing
Set adoCon = Nothing
%>
</body>
</html>

What else is there??



Posted By: MorningZ
Date Posted: 26 February 2003 at 10:47am
exactly like the error says, there is no item name in the recordset with the name of "Id_No", check your SQL again

its amazing how the error messages tell you exactly whats wrong

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: donnytree
Date Posted: 26 February 2003 at 5:21pm
Think I've nearly solved it now :D


Posted By: donnytree
Date Posted: 27 February 2003 at 5:30am

A short problem on the next page now ( http://www.te.fragworld.co.uk/teams/view_team.asp?Id_No=1 - http://www.te.fragworld.co.uk/teams/view_team.asp?Id_No=1  now hosted there.)

ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/teams/view_team.asp, line 0

What the hell??

Here is the code, can someone see something I can't

<html>
<head>
<title>Viewing Team Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
Dim adoCon          'Holds the Database Connection Object
Dim rsTeam    'Holds the recordset for the records in the database
Dim strSQL           'Holds the SQL query for the database
Dim lngRecordNo    'Holds the record number to be updated

'Read in the record number to be viewed
lngRecordNo = CLng(Request.QueryString("ID"))

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("team.mdb")

'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=team"

'Create an ADO recordset object
Set rsTeam = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Team.* FROM Team WHERE Id_No=" & lngRecordNo

'Open the recordset with the SQL query
 rsTeam.Open strSQL, adoCon

Response.Write("<table width='80%' border='0' cellpadding='0' cellspacing='0'>")
 Response.Write("<tr> ")
  Response.Write("<td width='150'height='150' valign='top'>")
  Response.Write("<img src='<rsTeam('Badge')>'>")
  Response.Write("</td>")
  Response.Write("<td width='449' valign='top'>")
  Response.Write("Club Name:")
  Response.Write(rsTeam("Team"))
  Response.Write("<br>")
  Response.Write("Ground:")
  Response.Write(rsTeam("Ground"))
  Response.Write("<br>")
  Response.Write("Coach:")
  Response.Write(rsTeam("Coach"))
  Response.Write("<br>")
  Response.Write("Captain:")
  Response.Write(rsTeam("Captain"))
  Response.Write("<br>")
  Response.Write("Current Division:")
  Response.Write(rsTeam("League"))
  Response.Write("<br>")
  Response.Write("Last Game vs Dragons:")
  Response.Write(rsTeam("Last_Match_Doncaster"))
  Response.Write("Last Match vs Dragons (Result):")
  Response.Write(rsTeam("Last_Match_Result"))
  Response.Write("</td>")
  Response.Write("</tr>")
  Response.Write("<tr>")
    Response.Write("<td height='167' valign='top' colspan='2'>")
 Response.Write("Club Information:")
 Response.Write(rsTeam("Info"))
Response.Write("</td>")
  Response.Write("</tr>")
Response.Write("</table>")
'Reset server objects
rsTeam.Close
Set rsTeam = Nothing
Set adoCon = Nothing
%>
</body>

</html>

Help (Again)




Posted By: Bunce
Date Posted: 27 February 2003 at 5:37am

The error means exactly what it says!

You are tyring to reference values from a recordset, except that the recordset is empty OR you are at the end of the recordset.



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: donnytree
Date Posted: 27 February 2003 at 5:47am

Sorry for sounding thick, its just I've got a stinking cold, headaches,and earaches.

How can I solve it?



Posted By: Bunce
Date Posted: 27 February 2003 at 6:04am
Work out why there aren't any records in your recodset

-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: donnytree
Date Posted: 27 February 2003 at 7:16am

Sorted it was this

lngRecordNo = CLng(Request.QueryString("ID"))

Should have been

lngRecordNo = CLng(Request.QueryString("Id_No"))

this



Posted By: MorningZ
Date Posted: 27 February 2003 at 8:07am
Originally posted by donnytree donnytree wrote:

Sorted it was this


<FONT color=#0000ff size=1>lngRecordNo = CLng(Request.QueryString("ID"))


<FONT color=black size=2>Should have been


<FONT color=#0000ff size=1>lngRecordNo = CLng(Request.QueryString("Id_No"))


<FONT color=black size=2>this


and with that code.. notice that just the link " http://www.te.fragworld.co.uk/teams/view_team.asp - http://www.te.fragworld.co.uk/teams/view_team.asp " crashes the page...

you need to make sure that there was an ID passed in

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: MorningZ
Date Posted: 27 February 2003 at 8:09am
and while that brings back the "no records found error", you need to simple check after doing the query if "rsTeam.EOF" as said about 10 replies ago...

not only that...
http://www.te.fragworld.co.uk/teams/view_team.asp?Id_No= - http://www.te.fragworld.co.uk/teams/view_team.asp?Id_No= flat out makes the whole page crash

-------------
Contribute to the working anarchy we fondly call the Internet



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net