mrbarbarik 0 Newbie Poster

Hi,

I'm just want to ask if it's possible if I want to update multiple record with same condition at the same time.

For example, I have a table named userTable, it has two field, year and status fields.
On year field, it has value of years and on status field has default value New.

I'am using asp to perform this operation :

var status = "Expired";
var year = "2012";

var sql  = "UPDATE userTable ";
    sql += "SET ";
    sql += "status = '"+status+"'";
    sql += "WHERE ";
    sql += "year = " +year;

On year field, it has multiple record that has value 2012. So, what i'm trying to do is to update record on status field which the year is equal to 2012.

It can run smoothly if only one record has year value equal to 2012, but not if has multiple record with same value.

I'm already try to run this code but got error. So, anyone can help me solve this problem.
Thank You.

mrbarbarik 0 Newbie Poster

Hi all,

I just want to know if there any asp code can make auto redirect from one page to another page when the session timeout end ?

Any solution for this problem ?

I need a solution ASAP, so help me please.

Thank You.

mrbarbarik 0 Newbie Poster

this is the code to display data, when link Delete clicked, it will redirect to page delete.asp:

-display.asp-

<%   var out ="";
    while ( ! rs.EOF )
    {   out += "<table><tr>";
        out += "<td width=75 bgcolor='#666666'>Catatan</td>";
        out += "<td bgcolor='#999999' width='300'>";
        out += String(ss.fields.item("catatan"));
        out += "</td></tr>";
        out += "<tr>";
        out += "<td width=75 bgcolor='#666666'>Kelulusan</td>";
        out += "<td bgcolor='#999999' width='300'>";
        out += String(ss.fields.item("kelulusan"));
        out += "</td></tr>";
        out += "<tr><td colspan=2><a href='delete.asp'>Delete</a></td></tr>";
        out += "</table>";

        rs.move(1);
     }Response.Write(out);
  %>

this is to delete data. The data to delete is displayed to confirm the delete process before user press button delete. This also the problem because it displayed the first top data, not the data I clicked. I think, it delete the first data found in database which the unique id match the condition:

-delete.asp-

<%
 var out = "";
if ( ! rs.EOF )
{     
 out += "<table><tr><td><u>Catatan : </u></td>";
 out += "<td>";
 out += String(rs.fields.item("catatan"));
 out += "<input type='hidden' name='ctt' value='"+String(rs.fields.item("catatan")) +"'>";
 out += "</td></tr>";
 out += "<tr><td><u>Kelulusan : </u></td>";
 out += "<td>";
 out += String(rs.fields.item("kelulusan"));
 out += "<input type='hidden' name='kls' value='"+String(rs.fields.item("kelulusan")) + " '>";
 out += "</td></tr></table>";              
 out += "<p><input type='submit' name='button' value='Delete'></p>";
}
else
{out = "<tr> <td> Record Not Found! </td> </tr>";}

Response.Write ( out );
%>
mrbarbarik 0 Newbie Poster

Hi all,

I'm newbie in asp.
I have a problem to delete the record on sql. I have one form for different users to insert data into sql where every user have are unique id, so it's possible to have multiple record with same unique id, then display the data recorded using while loop, so it will display all recorded data in sql based on that unique id.

I have placed a delete link in that while loop, so every data displayed will have link to delete it. The problem is, when I clicked the delete link on all data displayed except the first data displayed(data on the top), it will delete the first data displayed not the data I clicked.

So, anyone can help..please

mrbarbarik 0 Newbie Poster

I want to make server page that can keep a parameter just like tracking ID.
I want to pass that parameter from an asp page to another asp page when i clicked submit button.
Can someone help me to solve this, i really need to finish this soon.
So far have this code, this is January.asp page, i need to pass the userID parameter to userView.asp page :

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<%  if( Request.Form("button")=="Simpan")
   {var DSN = "Provider = Microsoft.JET.OLEDB.4.0; 
    Data Source =  C:/Inetpub/wwwroot/eKehadiran/eKehadiranDataBase.mdb";   
    var Conn = Server.CreateObject("ADODB.Connection");
    Conn.Open(DSN);
    var id  = Request.Form("userID");var kllsan = Request.Form("kelulusan");
    var abailabel = Request.Form("available");

    var sqlStmt = "INSERT INTO Januari ";
    sqlStmt += "( ID,catatan,kelulusan ) ";
    sqlStmt += "VALUES ";
    sqlStmt += "("; 
    sqlStmt += "'" + id + "',";
    sqlStmt += "'" + abailabel + "',";
    sqlStmt += "'" + kllsan + "'";
    sqlStmt += ")";
    var sqlStmnt = "UPDATE userTable SET availability = '" + abailabel + "'";
    sqlStmnt += "WHERE ID = "+ Request.Form("userId");
    Conn.Execute(sqlStmt);Conn.Execute(sqlStmnt);Conn.Close();
    Response.Redirect("userView.asp");}
 %> 
<%  var DSN = "Provider = Microsoft.JET.OLEDB.4.0; 
    Data Source = C:/Inetpub/wwwroot/eKehadiran/eKehadiranDataBase.mdb";   
    var Conn = Server.CreateObject("ADODB.Connection"); Conn.Open(DSN);

    var sqlStmt = "SELECT * FROM userTable ";
    sqlStmt += "WHERE ";
    sqlStmt += "ID = ";
    sqlStmt += Request.QueryString("userID");
    var sqlStmnt = "SELECT * FROM Januari ";
    sqlStmnt += "WHERE ";
    sqlStmnt += "ID = ";
    sqlStmnt += Request.QueryString("userID");
    var rs = Server.CreateObject("ADODB.Recordset");rs.Open ( sqlStmt, Conn );
    var ss = Server.CreateObject("ADODB.Recordset");ss.Open (sqlStmnt,Conn);
%>
<html>
<head><title>Untitled Document</title></head>
<body>
<table>
<tr><td><table>

<% var out = ""; …