|
 |
asp_web_howto thread: What is this?
Message #1 by jmusolini@y... on Sat, 21 Sep 2002 00:19:06
|
|
My ASP was working fine a moment ago, but all of the sudden I am getting
this message:
"unspecified error".
Do you know what this could be?
Any comments will be greatly appreciated.
Message #2 by "Vinnie \(Mailinglists Only\)" <vinnie@j...> on Sat, 21 Sep 2002 08:28:07 +0200
|
|
could you post the code ?
Thanks,
Vinnie
----- Original Message -----
From: <jmusolini@y...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Saturday, September 21, 2002 12:19 AM
Subject: [asp_web_howto] What is this?
> My ASP was working fine a moment ago, but all of the sudden I am getting
> this message:
> "unspecified error".
>
> Do you know what this could be?
> Any comments will be greatly appreciated.
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
Message #3 by jmusolini@y... on Sat, 21 Sep 2002 14:57:41
|
|
Here the first ASP Page:
*************************************************************************
<% Option Explicit %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<link rel="stylesheet" href="../css/style1.css" type="text/css">
</head>
<body topmargin="0" leftmargin="1">
<table border="0" width="758" cellspacing="0">
<tr>
<td width="754" bgcolor="#FFFFFF" align="center" colspan="5"><img
border="0" src="../images/36x760wave.gif">
<p><img border="0" src="../images/citi_logo.gif" align="left"></td>
</tr>
<tr>
<td width="70" bgcolor="#FFFFFF" align="center"> </td>
<td width="143" bgcolor="#FFFFFF" align="center"> </td>
<td width="414" bgcolor="#FFFFFF" align="center"> </td>
<td width="143" bgcolor="#FFFFFF" align="center"> </td>
<td width="49" bgcolor="#FFFFFF" align="center"> </td>
</tr>
<tr>
<td width="70" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>Date</b></font></td>
<td width="143" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>From</b></font></td>
<td width="345" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>To</b></font></td>
<td width="74" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>Category</b></font></td>
<td width="49" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>Read</b></font></td>
</tr>
<%
'Open connection to our sample DB
'I will use a DSN-less Connection
Dim objConn
Dim adOpenForwardOnly, adLockReadOnly, adCmdTable
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString= "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("sample.mdb")
adOpenForwardOnly = 0
adLockReadOnly = 1
adCmdTable = 2
objConn.Open
'Create a recordset object instance and get the info from the Memos table
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "Memos", objConn, , ,adCmdTable
dim i, bgcolor
i=0
Do While Not objrs.EOF
if i mod 2=0 then
bgcolor="#CCCCCC"
else
bgcolor="#FFFFFF"
end if
%>
<tr bgcolor="<%=bgcolor%>">
<td width="70" align="left"><%=objRS("Date")%></td>
<td width="143" align="left"><%=objRS("From")%></td>
<td width="345" align="left"><%=objRS("To")%></td>
<td width="74" align="left"><%=objRS("Category")%></td>
<td width="49" align="left"><a href="<%=objRS("Link")%
>">Memo</a></td>
</tr>
<% i=i+1
objRS.MoveNext
Loop
'Clean up our ADO objects
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<tr>
<td width="70"> </td>
<td width="143"> </td>
<td width="345"> </td>
<td width="74"> </td>
<td width="49"> </td>
</tr>
<form method="POST" action="0919_d.asp">
<tr>
<td width="70"> </td>
<td width="143">
<select size="1" name="FormMonth">
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
</td>
<td width="345"> </td>
<td width="74">
<select size="1" name="FormCategory">
<option>MIS</option>
<option>Procedure</option>
<option>Telecom</option>
<option>Reminder</option>
<option>News</option>
<option>Announcement</option>
</select>
</td>
<td width="49"> </td>
</tr>
<tr>
<td width="70"> </td>
<td width="143">
</td>
<td width="345"> </td>
<td width="74">
</td>
<td width="49"> </td>
</tr>
<tr>
<td width="70"></td>
<td width="143"><input type="submit" value="Submit">
</td>
<td width="345"><input type="reset" value="Reset" ></td>
<td width="74">
</td>
<td width="49"></td>
</tr>
<tr>
<td width="70"></td>
<td width="143">
</td>
<td width="345"></td>
<td width="74">
</td>
<td width="49"></td>
</tr>
</table>
</body>
</html>
*************************************************************************
Here the "0919_d.asp" which is the action of the form. This will allow
users to narrow down their search in the Database
*************************************************************************
<% Option Explicit %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<link rel="stylesheet" href="../css/style1.css" type="text/css">
</head>
<body topmargin="0" leftmargin="1">
<table border="0" width="754" cellspacing="0">
<tr>
<td width="754" bgcolor="#FFFFFF" align="center" colspan="5"><img
border="0" src="../images/36x760wave.gif">
<p><img border="0" src="../images/citi_logo.gif" align="left"></td>
</tr>
<tr>
<td width="70" bgcolor="#FFFFFF" align="center"> </td>
<td width="143" bgcolor="#FFFFFF" align="center"> </td>
<td width="209" bgcolor="#FFFFFF" align="center"> </td>
<td width="216" bgcolor="#FFFFFF" align="center"> </td>
<td width="108" bgcolor="#FFFFFF" align="center"> </td>
</tr>
<tr>
<td width="70" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>Date</b></font></td>
<td width="143" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>From</b></font></td>
<td width="209" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>To</b></font></td>
<td width="216" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>Category</b></font></td>
<td width="108" bgcolor="#000080" align="left"><font
color="#FFFFFF"><b>Subject</b></font></td>
</tr>
<%
'Open connection to our sample DB
'I will use a DSN-less Connection
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString= "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("sample.mdb")
objConn.Open
'Create our SQL statement variable
Dim strSQL
strSQL = "SELECT * FROM Memos WHERE Month = '" & Request("FormMonth")&"'
AND Category ='" & Request("FormCategory")& "'"
'Create a recordset object instance and get the info from the friends
table
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn
'If objRS.EOF Then
'Response.write " SORRY THERE IS NO MEMO FOUND!"
'End if
'Do While Not objRS.EOF
dim i, bgcolor
i=0
Do While Not objrs.EOF
if i mod 2=0 then
bgcolor="#CCCCCC"
else
bgcolor="#FFFFFF"
end if
%>
<tr bgcolor="<%=bgcolor%>">
<td width="70" align="left"><%=objRS("Date")%></td>
<td width="143" align="left"><%=objRS("From")%></td>
<td width="209" align="left"><%=objRS("To")%></td>
<td width="216" align="left"><%=objRS("Category")%></td>
<td width="108" align="left"><a href="<%=objRS("Link")%>"><%=objRS
("Subject")%></a></td>
</tr>
<% i=i+1
objRS.MoveNext
Loop
'Clean up our ADO objects
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<tr>
<td width="70"> </td>
<td width="143"> </td>
<td width="209"> </td>
<td width="216"></td>
<td width="108"></td>
</tr>
</table>
</body>
</html>
**************************************************************************
Thanks
|
|
 |