Hello.

I have 4 separate .aspx files that do different things for each file

1) One simply views the whole table of records on another page.

2) This one adds a new record

3) This one updates a record (One that's added), simply changing its name.

4) The last one deletes that record.

What I need to achieve is the following:

Put a link on my site. When the user clicks that link, all in one sitting, it displays the table of records, adds a new record, updates that record, and deletes that record. And that's it. This all has to happen within one .aspx file, and the user only needs to click once on the link for all of these to happen.

Here is the code for the separate .aspx files: (I've blocked out the DSN name for security purposes)

{Displays the table}

Code:
<%@ LANGUAGE = "JavaScript" DEBUG="true" %>
<html>
<body topmargin=0 leftmargin=0 marginwidth="0" marginheight="0">
<table border=1>
<thead>
<tr>
<th>CustomerID</th><th>Company</th><th>Address</th><th>City</th><th>State</th><th>Zip Code</th>
</tr>
</thead>
<%
  var adoConnection = new ActiveXObject("ADODB.Connection"); 
  var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/public_html/375/--------/Access1.accdb"; 
  var adoRecordset;
  var mySQL;
  adoConnection.Open("DSN=--------");
  mySQL = "select CustomerID, Company, Address, City, State, ZipCode from Customers";
  adoRecordset = adoConnection.Execute(mySQL);
  while (adoRecordset.Eof == false)
  {
%>
  <tr>
  <TD><%=adoRecordset("CustomerID").Value%></TD><TD><%=adoRecordset("Company").Value%></TD><TD><%=adoRecordset("Address").Value%></TD>
  <TD><%=adoRecordset("City").Value%></TD><TD><%=adoRecordset("State").Value%></TD><TD><%=adoRecordset("ZipCode").Value%></TD>

  </tr>
<% 
  adoRecordset.MoveNext();
  }
  adoRecordset.Close();
  adoRecordset = null;
  adoConnection.Close();
  adoConnection = null;
%>
</table>
</body>
</html>
{Adds a new record}

Code:
<%@ LANGUAGE = "JavaScript" DEBUG="true" %>
<html>
<body topmargin=0 leftmargin=0 marginwidth="0" marginheight="0">
<%
  var adoConnection = new ActiveXObject("ADODB.Connection"); 
  var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/public_html/375/Access1.accdb"; 
  var adoRecordset;
  var mySQL;
  adoConnection.Open("DSN=--------");
  mySQL = "INSERT INTO Customers (Company, Address, City, State, ZipCode) VALUES ('Carl','34 Main St.','Bloomsburg','PA','17815')";
  adoRecordset = adoConnection.Execute(mySQL);
  adoConnection.Close();
  adoConnection = null;
%>
</body>
</html>
{Updates the record}

Code:
<%@ LANGUAGE = "JavaScript" DEBUG="true" %>
<html>
<body topmargin=0 leftmargin=0 marginwidth="0" marginheight="0">
<%
  var adoConnection = new ActiveXObject("ADODB.Connection"); 
  var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/public_html/375/Access1.accdb"; 
  var adoRecordset;
  var mySQL;
  adoConnection.Open("DSN=--------");
  mySQL = "UPDATE Customers SET Company='Carmen' WHERE Company='Carl'";
  adoRecordset = adoConnection.Execute(mySQL);
  adoConnection.Close();
  adoConnection = null;
%>
</body>
</html>
{Deletes the record}

Code:
<%@ LANGUAGE = "JavaScript" DEBUG="true" %>
<html>
<body topmargin=0 leftmargin=0 marginwidth="0" marginheight="0">
<%
  var adoConnection = new ActiveXObject("ADODB.Connection"); 
  var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C://kjk39210/375/Access1.accdb"; 
  var adoRecordset;
  var mySQL;
  adoConnection.Open("DSN=--------");
  mySQL = "DELETE FROM Customers WHERE Company='Carmen'";
  adoRecordset = adoConnection.Execute(mySQL);
  adoConnection.Close();
  adoConnection = null;
%>
</body>
</html>

How can I achieve all of these tasks in one click? I've tried multiple methods, but all do not work.

Thanks

oddish