Access via WWW / ASP programming question...HELP! 
Author Message
 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>



Tue, 28 Aug 2001 03:00:00 GMT  
 Access via WWW / ASP programming question...HELP!
Brain,

    Youmay try removing the semicolon from the end of your sql statement and
asl omake sure you have spaces between key words (i.e. where). Also you
might have better luck by excuting the query this way
Set rs = Server.CreateObject("ADODB.Recordset")
sqlSelect = "SELECT * FROM [" & dbtoload & "] WHERE [RecordNumber] = 1"
set rs = cn.execute(sqlSelect)

Robert

Quote:

>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.andmore.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>



Sat, 08 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access to Acrobat PDX files via WWW

2. HELP!!: Can Connect via VB/Can't via ASP

3. http://www.besamung.de.vu http://www.besamung.de.vu http://www.besamung.de.vu http://www.besamung.de.vu http://www.besamung.de.vu http://www.besamung.de.vu

4. ASP, Access, Transform, SQL Question - HELP!

5. Accessing the A: drive from a program launched via a web page

6. questions about execute program via wscript.run

7. Defining sort orders of Access tables via ASP pages

8. Access MS Project data via the Microsoft.Project.OLEDB.9.0 in ASP

9. mail-merge MS Word and MS Access via ASP

10. SQL Statement - MS Access via IIS with .asp?

11. SQL Statement - MS Access via IIS with .asp?

 

 
Powered by phpBB® Forum Software