There are quite a few calls to the database but none of the statements return a huge data set.
Have a look and see what you think.....some is greatfully borrowed from another Tek-Tips forums user
<% @LANGUAGE = VBScript %>
<% Option Explicit
Response.Expires = 0
' ADO constants used in this page
Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adCmdTableDirect = &H0200
Const adUseClient = 3
Dim objConn, objRS, strQuery
Dim strConnection, strBuild, upd_address
dim SQLStmt, rsGroups, GroupsArray
Set objConn = Server.CreateObject("ADODB.Connection"

strConnection = "DSN=CEOWeb;Database=CEOWeb;UID=WebApp;Password=WApword;"
objConn.Open strConnection
Set objRS = Server.CreateObject("ADODB.recordset"
objRS.PageSize = 1
objRS.CacheSize = 1
objRS.CursorLocation = adUseClient
objRS.Open "login_names", strConnection, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
'get group names
SQLStmt = "select group_id, group_name from groups order by group_name"
set rsGroups = objConn.Execute(SQLStmt)
If Request.ServerVariables("CONTENT_LENGTH"

= 0 Then
objRS.AbsolutePage = 1
Else
Select Case Request.Form("Submit"

Case "Add"
if request.form("uname"

<> "" then
'check that the password match
if Request.Form("password1"

= Request.Form("password2"

then
'Build SQL command
strQuery = "INSERT INTO login_names VALUES ('" & Request.form("uname"

& "', '" & Request.form("password1"

& "', '" & Request.form("groupid"

& "')"
' execute the SQL Command
Set objRS = objConn.Execute(strQuery)
Set objConn = Server.CreateObject("ADODB.Connection"

strConnection = "DSN=CEOWeb;Database=CEOWEb;UID=WebApp;Password=WApword;"
objConn.Open strConnection
Set objRS = Server.CreateObject("ADODB.recordset"

objRS.PageSize = 1
objRS.CacheSize = 1
objRS.CursorLocation = adUseClient
objRS.Open "login_names", strConnection, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
Response.write("Record Added Successfully."

else
Response.Write("Please reenter password details"

end if
end if
Case "Delete"
if request.form("uname"

<> "" then
'Build SQL command
strQuery = "DELETE FROM login_names WHERE username = '" & Request.form("uname"

& "'"
' execute the SQL Command
Set objRS = objConn.Execute(strQuery)
Set objConn = Server.CreateObject("ADODB.Connection"

strConnection = "DSN=CEOWeb;Database=CEOWEb;UID=WebApp;Password=WApword;"
objConn.Open strConnection
Set objRS = Server.CreateObject("ADODB.recordset"

objRS.PageSize = 1
objRS.CacheSize = 1
objRS.CursorLocation = adUseClient
objRS.Open "login_names", strConnection, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
Response.Write("Record deleted successfully."

end if
Case "Update"
if request.form("uname"

<> "" then
'Build SQL command for saving record
strQuery = "UPDATE login_names SET username = '" & Request.form("uname"

& "'"
strQuery = strQuery & ", password = '" & Request.form("password1"

& "'"
strQuery = strQuery & ", group_id = " & Request.form("groupid"

strQuery = strQuery & " WHERE user_id = "
strQuery = strQuery & request.form("form_user_id"

& ";"
' execute the SQL Command
Set objRS = objConn.Execute(strQuery)
Set objConn = Server.CreateObject("ADODB.Connection"

strConnection = "DSN=CEOWeb;Database=CEOWEb;UID=WebApp;Password=WApword;"
objConn.Open strConnection
Set objRS = Server.CreateObject("ADODB.recordset"

objRS.PageSize = 1
objRS.CacheSize = 1
objRS.CursorLocation = adUseClient
objRS.Open "login_names", strConnection, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
Response.Write("Record updated successfully."

end if
End Select
End If
If Not objRS.EOF Then
Dim intRec, intValue, strValue %>
<Head>
<H2><A NAME="header1"></A>Web Users Administration</H2>
<SCRIPT language="javascript">
function EditUser(obj)
{
ChosenUser = obj.name;
strUserDetails = GetUserDetails(ChosenUser);
if (strUserDetails != '')
{
start = strUserDetails.split(","

;
ilength = start.length;
if (ilength > 0)
{
i = 0;
strUserName = start[0];
strPassword = start[1];
strGroupID = start[2];
}
//add values to textboxes for editing
document.frmEditUser.uname.value = strUserName;
document.frmEditUser.password1.value = strPassword;
document.frmEditUser.groupid.value = strGroupID;
//add value to hidden field
document.frmEditUser.form_user_id.value = ChosenUser;
}
}
</SCRIPT>
<SCRIPT language="vbscript">
function GetUserDetails(UserId)
set Conn = CreateObject("ADODB.Connection"

strConn = "DATABASE=CEOWeb;DSN=CEOWeb;UID=WebApp;Password=WApword;"
Conn.Open strConn
'get the name of the report
SQLStmt = "select username, password, group_id from login_names where user_id = " & UserId
rstemp = Conn.Execute(SQLStmt)
'add values to variables
strUserName = rstemp("username"

& ","
strPassword = rstemp("password"

& ","
strGroupID = rstemp("group_id"

'close the database connection
Conn.close
'pass values back
GetUserDetails = trim(strUserName) & trim(strPassword) & strGroupID
end function
function DisableButtons
frmEditUser.submit.enabled = true
end function
</SCRIPT>
</head>
<body>
<FORM name=MyForm>
<table>
<tr>
<td bgcolor="#f7efde" align=left style="FONT-SIZE: small"><%Response.Write "User Id:"%></td>
<td bgcolor="#f7efde" align=left style="FONT-SIZE: small"><%Response.Write "User Name:"%></td>
<td bgcolor="#f7efde" align=left style="FONT-SIZE: small"><%Response.Write "Password: "%></td>
<td bgcolor="#f7efde" align=left style="FONT-SIZE: small"><%Response.Write "Group Name: "%></td>
</tr>
<%do until objRS.eof%>
<tr>
<td><%Response.Write objRS("group_id"

%></td>
<td>
<INPUT type="text" id=text1 name=user readonly=true align=middle value=<%Response.Write objRS("username"

%>>
</td>
<td>
<INPUT type="password" id=text1 name=pass readonly=true value=<%Response.Write objRS("password"

%>>
</td>
<td>
<INPUT type="hidden" id=text1 name=Group readonly=true value=<%Response.Write objRS("group_id"

%>>
<%dim DBConn, strConn, rsName, SQLQuery
Set DBConn = CreateObject("ADODB.Connection"
strConn = "DATABASE=CEOWeb;DSN=CEOWeb;UID=WebApp;Password=WApword;"
DBConn.Open strConn
SQLQuery = "select group_name from groups where group_id = " & objRS("group_id"

Set rsName = DBConn.Execute(SQLQuery)%>
<%if not rsName.eof then%>
<INPUT type="text" id=text1 name=GroupName readonly=true value=<%Response.Write rsName("group_name"

%>>
<%end if
rsName.close
DBConn.Close
set rsName = nothing
set DBConn = nothing %>
</td>
<td>
<INPUT type="button" value="Edit" id="<%=objRS("user_id"

%>" name="<%=objRS("user_id"

%>" onclick="EditUser(this)">
</td>
</tr>
<%objRS.movenext
Loop
objRS.AbsolutePage = 1%>
</TABLE>
</FORM>
<FORM ACTION="<%=Request.ServerVariables("SCRIPT_NAME"

%>" METHOD="POST" NAME=frmEditUser>
<INPUT TYPE="hidden" NAME="form_user_id">
<HR>
Selected Details: <BR><BR>
<TABLE>
<tr>
<td>Username</td>
<td>Password</td>
<td>Re-Enter Password</td>
<td>Group Name</td>
</tr>
<tr>
<td><Input type="text" name="uname"><BR></td>
<td><Input type="password" name="password1"><BR></td>
<td><Input type="password" name="password2"><BR></td>
<td><SELECT id=select1 name=groupid>
<OPTION selected></OPTION>
<%dim RSArray, Number_Of_Records, i
'get group names
SQLStmt = "select group_id, group_name from groups order by group_name"
set rsGroups = objConn.Execute(SQLStmt)
RSArray = rsGroups.getrows
rsGroups.close
Number_Of_Records = Cdbl(UBound(RSArray, 2))
i = 0
do until i = Number_Of_Records + 1%>
<option value=<%=RSArray(0,i)%>><%=RSArray(1,i)%></option>
<%i = i + 1
loop%>
</SELECT>
</td>
</tr>
</table>
<INPUT TYPE="Submit" VALUE="Update" Name="Submit" >
<INPUT TYPE="Submit" VALUE="Delete" Name="Submit">
<INPUT TYPE="Submit" VALUE="Add" Name="Submit">
</FORM>
<%Else
Response.Write "No records found."
End If
objRS.Close
objConn.close
set objConn = nothing
Set objRS = Nothing%>
</body>
</html>