
Access via WWW / ASP programming question...HELP!
I am trying to make a make-shift knowledge base and am hitting a problem
with my delete confirmation page. It is not pulling the records down from
the table/database and displaying them. Does anyone see anything wrong with
this code? I can't...or am I just doing something wrong? All my record
names are one word (ex. IPAddress, ClientName, ect.), and so are the tables.
Thanks in advance...(code to follow after signature)
--
********************************************
Brian McCann
Networks & More! Inc.
Educational Technology Consultants
"The technology you need, the price you can afford, and the assurance that
it works."
24 Highland Bend
Island Heights, NJ 08732
(732)929-1485 (VOICE) (732)506-6797 (FAX)URL: http://www.*-*-*.com/
********************************************
<%
'--Setup Variables
session("idtonuke") = request.form("idtonuke")
idtonuke = Request.Form("idtonuke")
dbtoload = session("dbtoload")
'--Build column headers for table
Select Case dbtoload
Case "CoreClientInformation"
column1="Record Number"
column2="Client Name"
column3="Phone Number"
column4="Contact"
Case "CoreNetworkInformation"
column1="Record Number"
column2="Client"
column3="Domain Name"
column4="PDC"
Case "ItemConfigurationInformation"
column1="Record Number"
column2="Client"
column3="Item Description"
column4="Location"
End Select
'--Open connection
set cn = Server.CreateObject("ADODB.Connection")
cn.Open "FILEDSN=C:\Inetpub\wwwroot\staffarea\client kb\Client
Info.dsn","admin","clientkb"
'--Create the Recordset
Set rs = Server.CreateObject("ADODB.Recordset")
sqlSelect = "SELECT * FROM [" & dbtoload & "] WHERE [RecordNumber] = 1;"
rs.Open sqlSelect, cn
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>Confirm Record Deletion</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<h1 align="center"><font face="Arial">Confirm Record Deletion</font></h1>
<hr>
<p>You are about to delete the following record (number:
<% =idtonuke %>
) in database
<% =session("targetdb") %>
(only the first 4 fields are shown to simplify the display):</p>
<table border="1" width="100%">
<tr>
<td width="25%">
<% =Server.HTMLEncode(column1) %>
</td>
<td width="25%">
<% =Server.HTMLEncode(column2) %>
</td>
<td width="25%">
<% =Server.HTMLEncode(column3) %>
</td>
<td width="25%">
<% =Server.HTMLEncode(column4) %>
</td>
</tr>
<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
%>
<tr>
<td width="25%">
<%=Server.HTMLEncode(rs.Fields(field1).Value)%>
</td>
<td width="25%">
<%=Server.HTMLEncode(rs.Fields(field2).Value)%>
</td>
<td width="25%">
<%=Server.HTMLEncode(rs.Fields(field3).Value)%>
</td>
<td width="25%">
<%=Server.HTMLEncode(rs.Fields(field4).Value)%>
</td>
</tr>
<%
rs.MoveNext
loop
%>
</table>
<p><BR>
<FORM action="" id=FORM1 method=post name=FORM1></FORM></p>
<form method="post" action="edit-deleterecord-confirm.asp">
<input type="radio" name="Confirm" value="No" checked>No, I
want to change it.<BR>
<input type="radio" name="Confirm" value="Yes">All is well...Do IT!!!
<p><input type="submit" value="Do It!"></p>
<p>DEBUG INFO:</p>
<p>table being opened:
<% =session("dbtoload") %></p>
<% Response.Write (sqlSelect) %>
</form>
</body>
</html>