 |

|
How can i implement a module that with track users login/logout times using vb6 and sql server 2005. suggestions for the columns to use in the userlogs table. including but not limited to logid, username, logintime, logouttime, etc. Any help will be appreciated.
|
|
|
|

|
how to log up with database sql server 2008 :(
|
|
|
|

|
hi..,
This project is nice..
i need some extra information..
i need to Store login/logout information of employee from system login page into SQL data base automatically ..
Please Send that coding part ..
Thanks
|
|
|
|

|
i just want to track login & logout of employee.
login is track though login screen
logout is track by 3 way
1. session expired and sign off click which is done by me
2. browser close & or other login to other application as we have 10 menu for 3 project
which is seen all the project screen when we redirect to any project 1st time then login screen is seen.
i am searching for 2nd one codes
|
|
|
|

|
Thanks for your interest in this article BUT it's from 2001 and I'm retired.
---------------
Horatiu CRISTEA
|
|
|
|

|
Hi, can u please help me? i have difficulty to display error login message at correct place. Here is my script.Please find this word:"I WANT TO DISPLAY AT HERE" <%@LANGUAGE="JAVASCRIPT"%> <!--#include file="Connections/GACFreight.asp" --> <% var Recordset1 = Server.CreateObject("ADODB.Recordset"); Recordset1.ActiveConnection = MM_GACFreight_STRING; Recordset1.Source = "SELECT * FROM DBA.Register"; Recordset1.CursorType = 0; Recordset1.CursorLocation = 2; Recordset1.LockType = 1; Recordset1.Open(); var Recordset1_numRows = 0; %> <% // *** Validate request to log in to this site. var MM_LoginAction = Request.ServerVariables("URL"); if (Request.QueryString!="") MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString); var MM_valUsername=String(Request.Form("username")); if (MM_valUsername != "undefined") { var MM_fldUserAuthorization="access_level"; var MM_redirectLoginSuccess="Main.asp"; var MM_redirectLoginFailed="Index.asp"; var MM_flag="ADODB.Recordset"; var MM_rsUser = Server.CreateObject(MM_flag); MM_rsUser.ActiveConnection = MM_GACFreight_STRING; MM_rsUser.Source = "SELECT userid, password"; if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization; MM_rsUser.Source += " FROM DBA.Register WHERE userid='" + MM_valUsername.replace(/'/g, "''") + "' AND password='" + String(Request.Form("password")).replace(/'/g, "''") + "'"; MM_rsUser.CursorType = 0; MM_rsUser.CursorLocation = 2; MM_rsUser.LockType = 3; MM_rsUser.Open(); if (!MM_rsUser.EOF || !MM_rsUser.BOF) { // username and password match - this is a valid user Session("MM_Username") = MM_valUsername; if (MM_fldUserAuthorization != "") { Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value); } else { Session("MM_UserAuthorization") = ""; } if (String(Request.QueryString("accessdenied")) != "undefined" && false) { MM_redirectLoginSuccess = Request.QueryString("accessdenied"); } MM_rsUser.Close(); Response.Redirect(MM_redirectLoginSuccess); } MM_rsUser.Close(); Response.Write("Please Enter a Valid Username and Password"); } %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>GAC Freight</title> <style type="text/css"> <!-- .style1 {color: #FF0000} .style5 {font-family: Arial, Helvetica, sans-serif} .style6 {font-size: 11px; font-family: Arial, Helvetica, sans-serif; } body { background-color: #ADC6C6; margin-top: 0px; margin-bottom: 0px; } .style7 {color: #999999} a:link { color: #666666; text-decoration: none; } a:visited { color: #666666; text-decoration: none; } a:hover { color: #993300; text-decoration: underline; } a:active { color: #993300; text-decoration: none; } .style11 {font-size: 36} .style21 { color: #1C3637; font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; } .style23 {font-family: Verdana; font-size: 10px; color: #1C3637;} .style26 { color: #D6E2DE; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; } .style27 { font-family: Verdana; font-size: 11px; } .style29 {font-size: 12px; color: #999999; } .style31 {font-size: 10px} .style32 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #1C3637; } .style33 {font-size: 12px} .style37 {font-family: Verdana; font-size: 12px; color: #1C3637; } .style40 {color: #D6E2DE; font-family: Verdana; font-size: 14px; font-weight: bold; } .style41 { font-family: Verdana; font-size: 10px; } --> </style> </head> <body onLoad="dayImage()"> <table width="808" height="553" border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF" > <tr> <td width="804" height="120" valign="top" bgcolor="#FFFFFF"> <table width="804" height="120" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF" > <tr> <td width="200" height="120" valign="top" bgcolor="#FFFFFF"><img src="Images/GACLogoTopLeft.gif" width="200" height="120" /></td> <td width="2" bgcolor="#FFFFFF"></td> <td width="602" height="120" valign="top" bgcolor="#FFFFFF"><img src="Images/topbanner2.gif" name="topBanner" width="602" height="120" /></td> </tr> </table> </td> </tr> <tr> <td width="802" height="18" valign="middle" bgcolor="#346667"> <table width="802" height="18" border="0" cellpadding="0" cellspacing="0" bordercolor="#346667" bgcolor="#346667" > <tr> <td width="802"><img src="Images/line.gif" width="804" height="16" /></td> </tr> </table> </td> </tr> <tr> <td width="804" height="386" valign="top" bgcolor="#FFFFFF" class="style11"> <table width="804" height="384" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="200" height="384" align="center" valign="top" bgcolor="#D6E2DE"> <br /> <table width="185" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top" bgcolor="#D6E2DE" class="style6 style7"> <div id="SGPDAY" align="center"> </div></td> </tr> <tr> <td align="center" valign="top" bgcolor="#D6E2DE" class="style6 style7"> <div id="SGPTIME" align="center"> </div></td> </tr> <tr> <td><p align="center"> </p> <div align="center"><span class="style23 style27 style31">GACfreight is an in-house software system developed for the operational and management of Gulf Agency Company freight forwarding business worldwide </span></div></td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"><span class="style23">It is a single encompassing application providing functionality required for the management of data relating to import and export of air, sea, and road freight movements </span></div></td> </tr> </table> <br /> <br /> <br /> <br /> <br /> <table width="200" height="59" border="0"> <tr> <td height="31" align="center" valign="top"><a href="http://www.gacworld.com" target="_blank" class="style21 style27">GACWorld</a></td> </tr> <tr> <td height="22" align="center" valign="bottom"><img src="Images/Mail.gif" width="15" height="13" /><span class="style41"><a href="mailto:gacfreight@gacworld.com"> Email Us</a></span></td> </tr> </table> </td> <td width="2" bgcolor="#FFFFFF"></td> <td width="602" valign="top" background="Images/worldmap.gif"><div align="center"> <p> </p> <table width="320" height="181" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D6E2DE" > <tr> <td height="32" colspan="3" align="center" bgcolor="#79A3A3"><span class="style40">Login to GACfreight</span></td> </tr> <tr> <td height="5" colspan="3" align="left"><div align="center" class="style26"><img src="Images/line2.gif" width="320" height="8" align="top" /></div> </td> </tr> <tr> <td width="310" height="141"><form ACTION="<%=MM_LoginAction%>" id="form1" name="form1" method="POST"> <table width="320" height="141" border="0" align="left" cellpadding="5" cellspacing="0" background="Images/greenbackground.gif"> <tr> <td width="78" height="32" align="center" valign="middle"> <p class="style37">Username</p> </td> <td colspan="2" align="left" valign="bottom"> <p> <input name="username" type="text" id="username" /></p> </td> </tr> <tr> <td height="32" align="center" valign="middle"class="style37">Password</td> <td colspan="2" align="left" valign="middle"> <input name="password" type="password" id="password" /> </td> </tr> <tr> <td height="34" align="left" valign="top"> </td> <td width="66" align="left" valign="top"><input name="Submit" type="submit" value="Sign In" /> </td> <td width="146" align="left" valign="top"><input name="Submit2" type="reset" value="Reset" /> </td> </tr> <tr> <td height="41" colspan="3" align="left" valign="top"><table width="300" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="31" align="left" valign="top" class="style5"><a href="mailto:gacfreight@gacworld.com" class="style23">Forgot Password? <<click here </a><br />I WANT TO DISPLAY AT HERE <a name="error" id="error"></a></td> </tr> </table></td> </tr> <tr> <td colspan="3" align="left" valign="top" class="style1"></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" class="style1"></td> </tr> </table> </form></td> </tr> </table> <br /> <br /> <br /> </div> <table width="600" height="96" border="0"> <tr valign="bottom"> <td height="92"><img src="Images/bottom_pic.gif" width="595" height="90" align="middle" /></td> </tr> </table> </td> </tr> </table></td> </tr> <tr> <td height="21" valign="top" bgcolor="#FFFFFF" class="style6 style7" style="padding-top:5px; padding-left:3px">Gulf Agency Company. Copyright © 2007</td> </tr> </table> </body> </html> <% Recordset1.Close(); %> Regards, Maria
|
|
|
|

|
You just have to write the error message into a variable. Then display the variable in the your html below the script.
instead of doing:
Response.Write("Please Enter a Valid Username and Password");
do something like this:
var errorMessage = "";
....
if (cant find any match) {
.....
errorMessage = "Please Enter a Valid Username and Password";
}
then inside the html write the error message at your desired location:
<%= errorMessage %>
---------------
Horatiu CRISTEA
|
|
|
|

|
Hi Horatiu, thank for ur reply.
however, i still dont get it. this is the first time for me to develop online website and do in ASP.Javascript. in which statement do i need to code the function that u give to me? (based on my script). appreciate if u can show me step by step. thanks
|
|
|
|

|
I'm sorry but i dont have time to give you a step by step working solution. You need to read more about asp and javascript, then this will be very clear to you. good luck.
---------------
Horatiu CRISTEA
|
|
|
|

|
ok, thanks. at least, can u check this code below whether correct or not
var errorMessage = "";
if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
// username and password match - this is a valid user
Session("MM_Username") = MM_valUsername;
if (MM_fldUserAuthorization != "") {
Session("MM_UserAuthorization")=String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
}
else {
Session("MM_UserAuthorization") = "";
}
if (String(Request.QueryString("accessdenied")) != "undefined" && false) {
MM_redirectLoginSuccess = Request.QueryString("accessdenied");
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginSuccess);
}
errorMessage = "Please Enter a Valid Username and Password";
|
|
|
|

|
it seems ok
---------------
Horatiu CRISTEA
|
|
|
|

|
thanks, its working now!
|
|
|
|

|
Hi, can u please help me? i have difficulty to display error login message at correct place. Here is my script.Please find this word:"I WANT TO DISPLAY AT HERE" <%@LANGUAGE="JAVASCRIPT"%> <!--#include file="Connections/GACFreight.asp" --> <% var Recordset1 = Server.CreateObject("ADODB.Recordset"); Recordset1.ActiveConnection = MM_GACFreight_STRING; Recordset1.Source = "SELECT * FROM DBA.Register"; Recordset1.CursorType = 0; Recordset1.CursorLocation = 2; Recordset1.LockType = 1; Recordset1.Open(); var Recordset1_numRows = 0; %> <% // *** Validate request to log in to this site. var MM_LoginAction = Request.ServerVariables("URL"); if (Request.QueryString!="") MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString); var MM_valUsername=String(Request.Form("username")); if (MM_valUsername != "undefined") { var MM_fldUserAuthorization="access_level"; var MM_redirectLoginSuccess="Main.asp"; var MM_redirectLoginFailed="Index.asp"; var MM_flag="ADODB.Recordset"; var MM_rsUser = Server.CreateObject(MM_flag); MM_rsUser.ActiveConnection = MM_GACFreight_STRING; MM_rsUser.Source = "SELECT userid, password"; if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization; MM_rsUser.Source += " FROM DBA.Register WHERE userid='" + MM_valUsername.replace(/'/g, "''") + "' AND password='" + String(Request.Form("password")).replace(/'/g, "''") + "'"; MM_rsUser.CursorType = 0; MM_rsUser.CursorLocation = 2; MM_rsUser.LockType = 3; MM_rsUser.Open(); if (!MM_rsUser.EOF || !MM_rsUser.BOF) { // username and password match - this is a valid user Session("MM_Username") = MM_valUsername; if (MM_fldUserAuthorization != "") { Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value); } else { Session("MM_UserAuthorization") = ""; } if (String(Request.QueryString("accessdenied")) != "undefined" && false) { MM_redirectLoginSuccess = Request.QueryString("accessdenied"); } MM_rsUser.Close(); Response.Redirect(MM_redirectLoginSuccess); } MM_rsUser.Close(); Response.Write("Please Enter a Valid Username and Password"); } %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>GAC Freight</title> <SCRIPT LANGUAGE="JavaScript"> <!--
<!-- function dayImage() { bannerImages = new Array("Images/topbanner1.gif", "Images/topbanner2.gif", "Images/topbanner3.gif", "Images/topbanner4.gif", "Images/topbanner5.gif", "Images/topbanner6.gif", "Images/topbanner1.gif"); now = new Date(); num = now.getDay(); num %= bannerImages.length; if(document.topBanner) { document.topBanner.src=bannerImages[num] } } // --> //--> </SCRIPT> <style type="text/css"> <!-- .style1 {color: #FF0000} .style5 {font-family: Arial, Helvetica, sans-serif} .style6 {font-size: 11px; font-family: Arial, Helvetica, sans-serif; } body { background-color: #ADC6C6; margin-top: 0px; margin-bottom: 0px; } .style7 {color: #999999} a:link { color: #666666; text-decoration: none; } a:visited { color: #666666; text-decoration: none; } a:hover { color: #993300; text-decoration: underline; } a:active { color: #993300; text-decoration: none; } .style11 {font-size: 36} .style21 { color: #1C3637; font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; } .style23 {font-family: Verdana; font-size: 10px; color: #1C3637;} .style26 { color: #D6E2DE; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; } .style27 { font-family: Verdana; font-size: 11px; } .style29 {font-size: 12px; color: #999999; } .style31 {font-size: 10px} .style32 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #1C3637; } .style33 {font-size: 12px} .style37 {font-family: Verdana; font-size: 12px; color: #1C3637; } .style40 {color: #D6E2DE; font-family: Verdana; font-size: 14px; font-weight: bold; } .style41 { font-family: Verdana; font-size: 10px; } --> </style> </head> <body onLoad="dayImage()"> <table width="808" height="553" border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF" > <tr> <td width="804" height="120" valign="top" bgcolor="#FFFFFF"> <table width="804" height="120" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF" > <tr> <td width="200" height="120" valign="top" bgcolor="#FFFFFF"><img src="Images/GACLogoTopLeft.gif" width="200" height="120" /></td> <td width="2" bgcolor="#FFFFFF"></td> <td width="602" height="120" valign="top" bgcolor="#FFFFFF"><img src="Images/topbanner2.gif" name="topBanner" width="602" height="120" /></td> </tr> </table> </td> </tr> <tr> <td width="802" height="18" valign="middle" bgcolor="#346667"> <table width="802" height="18" border="0" cellpadding="0" cellspacing="0" bordercolor="#346667" bgcolor="#346667" > <tr> <td width="802"><img src="Images/line.gif" width="804" height="16" /></td> </tr> </table> </td> </tr> <tr> <td width="804" height="386" valign="top" bgcolor="#FFFFFF" class="style11"> <table width="804" height="384" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="200" height="384" align="center" valign="top" bgcolor="#D6E2DE"> <br /> <table width="185" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top" bgcolor="#D6E2DE" class="style6 style7"> <div id="SGPDAY" align="center"> </div></td> </tr> <tr> <td align="center" valign="top" bgcolor="#D6E2DE" class="style6 style7"> <div id="SGPTIME" align="center"> </div></td> </tr> <tr> <td><p align="center"> </p> <div align="center"><span class="style23 style27 style31">GACfreight is an in-house software system developed for the operational and management of Gulf Agency Company freight forwarding business worldwide </span></div></td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"><span class="style23">It is a single encompassing application providing functionality required for the management of data relating to import and export of air, sea, and road freight movements </span></div></td> </tr> </table> <br /> <br /> <br /> <br /> <br /> <table width="200" height="59" border="0"> <tr> <td height="31" align="center" valign="top"><a href="http://www.gacworld.com" target="_blank" class="style21 style27">GACWorld</a></td> </tr> <tr> <td height="22" align="center" valign="bottom"><img src="Images/Mail.gif" width="15" height="13" /><span class="style41"><a href="mailto:gacfreight@gacworld.com"> Email Us</a></span></td> </tr> </table> </td> <td width="2" bgcolor="#FFFFFF"></td> <td width="602" valign="top" background="Images/worldmap.gif"><div align="center"> <p> </p> <table width="320" height="181" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D6E2DE" > <tr> <td height="32" colspan="3" align="center" bgcolor="#79A3A3"><span class="style40">Login to GACfreight</span></td> </tr> <tr> <td height="5" colspan="3" align="left"><div align="center" class="style26"><img src="Images/line2.gif" width="320" height="8" align="top" /></div> </td> </tr> <tr> <td width="310" height="141"><form ACTION="<%=MM_LoginAction%>" id="form1" name="form1" method="POST"> <table width="320" height="141" border="0" align="left" cellpadding="5" cellspacing="0" background="Images/greenbackground.gif"> <tr> <td width="78" height="32" align="center" valign="middle"> <p class="style37">Username</p> </td> <td colspan="2" align="left" valign="bottom"> <p> <input name="username" type="text" id="username" /></p> </td> </tr> <tr> <td height="32" align="center" valign="middle"class="style37">Password</td> <td colspan="2" align="left" valign="middle"> <input name="password" type="password" id="password" /> </td> </tr> <tr> <td height="34" align="left" valign="top"> </td> <td width="66" align="left" valign="top"><input name="Submit" type="submit" value="Sign In" /> </td> <td width="146" align="left" valign="top"><input name="Submit2" type="reset" value="Reset" /> </td> </tr> <tr> <td height="41" colspan="3" align="left" valign="top"><table width="300" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="31" align="left" valign="top" class="style5"><a href="mailto:gacfreight@gacworld.com" class="style23">Forgot Password? <<click here </a><br />I WANT TO DISPLAY AT HERE <a name="error" id="error"></a></td> </tr> </table></td> </tr> <tr> <td colspan="3" align="left" valign="top" class="style1"></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" class="style1"></td> </tr> </table> </form></td> </tr> </table> <br /> <br /> <br /> </div> <table width="600" height="96" border="0"> <tr valign="bottom"> <td height="92"><img src="Images/bottom_pic.gif" width="595" height="90" align="middle" /></td> </tr> </table> </td> </tr> </table></td> </tr> <tr> <td height="21" valign="top" bgcolor="#FFFFFF" class="style6 style7" style="padding-top:5px; padding-left:3px">Gulf Agency Company. Copyright © 2007</td> </tr> </table> <script language="JavaScript"> function dispSgpTime() { var today = new Date(); var thisZone = today.getTimezoneOffset() / 60; var thisMonth = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); var thisDay = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); var sgpYear = today.getFullYear(); var sgpMonth = thisMonth[today.getMonth()]; var sgpDate = today.getDate(); var sgpDay = thisDay[today.getDay()]; var thisHour = today.getHours(); var sgpHour = thisHour + (8 + thisZone); var sgpMin = today.getMinutes(); var sgpSec = today.getSeconds(); if (sgpDate < 10) sgpDate = "0" + sgpDate; if (sgpYear < 10) sgpYear = "0" + sgpYear; if (sgpHour < 10) sgpHour = "0" + sgpHour; if (sgpHour > 24) sgpHour = sgpHour - 24; if (sgpMin < 10) sgpMin = "0" + sgpMin; if (sgpSec < 10) sgpSec = "0" + sgpSec; document.getElementById('SGPDAY').innerHTML = "Singapore Time"; document.getElementById('SGPTIME').innerHTML = sgpDay + " " + sgpDate + " " + sgpMonth + " " + sgpYear + ", " + sgpHour + ":" + sgpMin; setTimeout('dispSgpTime()',1000); } dispSgpTime(); </script> <script language="JavaScript"> document.form1.username.focus(); </script> </body> </html> <% Recordset1.Close(); %> Regards, Maria
|
|
|
|

|
hi,
help me for setting session time out
Signature preview shobha 10:49 20 Apr '07
[Message text goes here]
|
|
|
|

|
I am using asp.net and vb language? How could I do in your
session("member")=rs("id")
how should i define rs as?
|
|
|
|

|
use the vb to c# converter and ur issue is solved,,
|
|
|
|

|
Error Type
ODBC Drivers (0x80040E14)
IIS 5.1
Syntax error in date in query expression '#10.11.2005 21:56:55#'.
/login.asp, line 46
ttt
|
|
|
|

|
how we know that what user has done in the website i.e
how we create a log file that can record all transaction done by the user.
parvez qureshi
|
|
|
|

|
Hi Mr.Horatiu CRISTEA or anybody out there..
im still new with ASP, i just wanna ask how i want to make the Logtime recorded into my database?i have tried the code n everything is ok except for the Logout time..can u pls explain more.thank you.
im still learning..
|
|
|
|

|
hello all,
I have a problem reguarding global.asa files session_onend(). I set sesion timeout to 1 min for the testing purpose, all pages & global.asa is in root directory then it works fine . But when I use nested directory structure ,session on end do not fires. Can anybody help me reguarding this ..
reguards
Dhanashree
|
|
|
|

|
I wanted to have this connect to a sql DB on a seperate server what should be changed to do this? i could change it in the conn,open line with a DSN or in the global.asa by changing th Driver= ...?
|
|
|
|

|
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
what this mean?
|
|
|
|

|
In this example session variable is used to store the userid, is there any alternative method (and should be a safe method)?
|
|
|
|

|
another alternative is to do the session management in DB.
the session management with the session object is safe enough in my opinion. the only bad thing is that it doesnt work on browsers that do not accept cookies.
---------------
Horatiu CRISTEA
|
|
|
|
|

|
Any answers as to why I get this error when trying to log in???
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/login/login.asp, line 26
|
|
|
|

|
i am also facing the same problem here. Pls anyone reply to this
|
|
|
|

|
can you be more specific?
---------------
Horatiu CRISTEA
|
|
|
|

|
you must set the connection string o point to the database.
check global.asa file.
also, check your permisions on the mdb file.
---------------
Horatiu CRISTEA
|
|
|
|

|
Hi Patrick, Horatiu or anyone,
I still gor the problem as above, I point to the mdb in the osa file and also set the permissions. wat else shld i do?
Rgds,
James
|
|
|
|

|
Hi !
HOw to track the user and record or update logout time. when the user logged in and closed the browser before session time out
Any help 'll be appreciated
Ravi Ayitha
|
|
|
|

|
Good idea is to use javascript method in body of main document in window. You have to create a handle to event onUnload. This event occurs on closing the window or even loading new document in location. The main thing is that this document cannot refresh or reload during using application. So the solution is to have in the window one frame with constant document. You can define second frame with width 1 (invisible) where you can load the document on start of application and not refresh it. After you close whole window or enter new adress into viewers location edit text you reload this constant document (because you reload whole location). And then the event Unload occurs. In response to this event you can open new window in which you load script asp and insert method Session.Abandon. After that, you can also automatically close this new window. This new window is a child of the first one so parent's session is of course transfer to new window. (unless you load to new window script from other server, but I assume you don't).
|
|
|
|

|
The link does not work, or what?
|
|
|
|
|
|
|

|
After getting this feature to work on my localhost (WinXP IIS v5.1), I had some troubles getting this feature to work on my hosting server. My host is running Win2000 and IIS v5.0.
Even after setting the IWAM permission on the database, I still couldn't get the feature to work. There is a BUG in IIS v5.0 (and 4.0). When the Session_OnEnd event is fired, there is a change in which process token runs. COM components use a different process token than that of the Session_OnEnd.
Anyway, for more information, check out:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q243828
|
|
|
|

|
Hi,
I had no idea about the bug but I've tested the application on IIS 5.0 and IIS 4.0 and it worked on both.
I have on my personal machine IIS 5.0 and Service Pack 2 installed and I can run the application.
if you cannot use the solution with the session object then another idea would be to move the session management in the database.
generate a session ID each time the user login, associate the session id with the user id, build an "expire" mechanism in the db and the rest of the idea is the same as in this article.
---------------
Horatiu CRISTEA
|
|
|
|

|
I tried everything as it was directed in the article to try and get the online user system working. I set the permissions on the database, debugged and tested the firing of each sub in the global.asa. Everything was good, but the code was still not setting the "online" flag in the database.
As it was, IIS did not like the "new line" under each of the sub declarations in the global.asa file and therefore didn't complete the routine.
Just thought I'd let you all know, if in case you too have tried everything and it's still not working and you have a new line under your decs.
|
|
|
|

|
Hi all,
I really had a hard time and after unsuccessful tries i am posting the problem with the hope that somebody will help me.
First the system background:
I tried it on both WinXp and Win2k 2000 server. The database is stored on the Non-NTFS partition so there shouldn't be any Read/write problems (as far as i know).
The Global.asa file is working 100% as when i change the Session out time, it works.
I copied the and tried to run the code as an .asp page and i get the error that it is not allowed for such updates. Which more or less tells me that the system cannot update the database.
So is there any other setting which would allow the system to update the database when i am not using the NTFS partition??
Any suggestion??
I thankyou in advance!
Regards
Khan
|
|
|
|

|
here are the detailed instructions how to make this script work.
this is for win2k.
1. unzip the zip archive in a folder on ur hdd.
2. from Internet Services Manager ( Control pannel > Administrative tools > Internet Service Manager) make a virtual directory to point on the folder where u unzipped the files.
3. Edit Global.asa file and make the folowing modification at the line 34:
instead of the line:
Application("connString") = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=path to test.mdb on ur server."
replace it with this one:
Application("connString") = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath( "test.mdb" )
4. make sure that the permissions are set corectly on the file called "test.mdb".
corectly means that the user IUSR_<machine> and IWAM_<machine> have modify rights on "test.mdb" file.
this should be all.
if IUSR_<machine> doesnt have rights to write on the access database u wont be able to insert a record and u will receive an error message like this:
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
if IWAM_<machine> doesnt have modify rights on test.mdb then the Session_OnEnd procedure wont be executed and the time when u logout wont be recorded, instead u will see a N/A.
run 1rst login.asp page and for username and pass u can take a look in the db and u will see that there are 2 users:
1. user1/pass1
2. user2/pass2
if u experience more problems write me an email.
---------------
Horatiu CRISTEA
|
|
|
|

|
Thanx alot for the reply,
As i wrote earlier i modified the rights and the database connection.
The problem was the code was not running. I had to modify the "where part" of the update query
and set the session variable to some variable (not directly to field Userid) and then again the variable to the SV.
Regards
|
|
|
|

|
does any one have online student information system
|
|
|
|

|
try www.oledu.com/mls.html. This site is full of awesome courses like these, over 130 in total including asp, asp.net all for only $199.95 for one year access to all these courses. In order to get the discount price contact the owner of the page michaelsandrock@hotmail.com (subject = oledu)there is also a free trial for you.
|
|
|
|

|
First of all, thank you for the good article. However, I want to point something out to you.
Let's say that timeout of the site is set to 30 minutes and user spends 5 minutes on the site on average. I think that most users do not click logout and simply close the browser or go to the other site. Since you are only capturing logoff time on Session_OnEnd your times on average will be 5-6 times greater than real times spent by average user on your site. If this is really the case - it renders results of your time capturing almost useless for any kind of meaningful analysis.
I believe that the accuracy can be greatly improved by using a Session variable that will store the time of last page processed. Of cause, it will not work for html (non-ASP) pages, but one have to assume that site that uses login script will actually have ASP pages across the board. Most ASP applications have some kind of include files that are being included in every ASP page. For example, all my pages include file with common functions. So my solution will be to include a simple line
Session("LastProcessTime") = Now()
somewhere in your common include file. Then all you need to do is to store Session("LastProcessTime") in your database as your Logout_Time on Session_OnEnd instead of storing current time.
This approach will still not give you perfect times. Actually, the times you record will always be a little shorter than times spent by user, but I believe that it will give you a much more accurate results.
You can take it even farther and store both Now() and Session("LastProcessTime") in your database. You can simply show both to your users or use some kind of time approximation or averaging algorithm to estimate "real" logoff time.
I hope this makes sense.
Thanks.
|
|
|
|

|
That doesn't make much sense because that's exactly how IIS measures timeouts. It logs the time of last page access, and from then on, it starts a countdown of Timeout minutes. It doesn't make sense because when the session timeouts you can measure the time of "logout" by substracting Timeout from Now ().
So you can calculate your
Session("LastProcessTime") = Now () - Session.Timeout
What someone could do is to measure the average session for a period of time, and adjust statistically the length of the session so that it has as little impact on web server performance, but still take advantage of ASP sessions.
Ciprian Miclaus
www.ciprian-miclaus.com
|
|
|
|
|

|
I have had to do away with session useage on my sites due to the load on the server during high traffic times.
I haven't regretted it.
Another possibility is to use cookies instead of session info.
Cookies have another advantage, some users browse a site with more than one browser window open. With sessions, each window is treated as a seperate session. It can be a bit disorienting to be placing things in a shopping cart and find them gone in the other browser. With cookies both browsers have current info. Example you can add an item to the shopping cart and view the cart in the other browser and all is well.
Just a thought.
|
|
|
|

|
hmm.. i dont think that the server will open another session for each window opened. the session is based on cookies too so it will have the same behaviour like using cookies and exactly like cookies they on the browser. so u could open new browser windows and the session will be mentained.
i've made shoping carts based on session and worked fine even if i would browse the site with more than 1 window. maybe i will post an article like that
---------------
Horatiu CRISTEA
|
|
|
|

|
I know for sure that session info is "not" maintained common to multiple browser windows.
One of my sites uses session stored usernames. When a visitor logs on to the site, the site displays the user's name at the top of every webpage visited. I can open two browsers and have seperate users logged on with no interaction between them.
My understanding is that when a browser window requests an asp page that a unique sessionid is created and is sent back and forth between the browser and the webserver in the webpage header.
|
|
|
|
 |