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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is wrong with this code? 1

Status
Not open for further replies.

bvioletap

Programmer
Jul 24, 2006
1
RO
Hello
I tired to create an asp page (grupa_aaa.asp) for show me information from a table materials (materiale.mdb). Not work. Give me error: "The page cannot be display" What is wrong in code below?
<html>
<body>
<%
set conn=Server.CreateObject("ADODB.Connection")
'conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.open"Driver={Microsoft Access Driver(*.mdb)};DBQ=" & Server.MapPath("/materiale.mdb")
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Materials",conn
if rs.EOF then
response.write "No Records!"
else
%>
<table border="1" width="100%">
<%do until rs.EOF%>
<tr>
<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%></td>
<%next
rs.MoveNext%>
</tr>
<%loop
end if
rs.close
conn.close
%>
</table>
</body>
</html>
 
rs.close is not a valid method.
To cleanup those objects you should do something like:
Set rs = Nothing
conn.Close
Set conn = Nothing


Also, if your not getting a detailed error message in the browser about what line has an error:
1) In IE go to the settings and turn off the setting for "Show Friendly HTTP Error Messages"
2) In IIS (Advanced Settings > Internet Services Manager) there is a setting to show detailed error messages. I don't have my Windows machine on at the moment, but I believe it is something like: Right Click Default Website > Properties > Configuration > App Settings tab > bottom section

I think I missed a step in the IIS instructions above, but it should be close enough to help.

-T

 
Whoops, ignore the first part of my last reply. I was thinking in the wrong language again. Definitely do the second part and post back with more detailed error information.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top