473,326 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

more than 1 per row?

Hey gang.
I know this is probably an easy solution, but I don't remember how to do it.

I have this code;

<%
If rstActiveUsers.RecordCount 0 Then
rstActiveUsers.MoveFirst
Do While Not rstActiveUsers.EOF
var_user1 = session("username") %>
<td class="tdblock" align="left">
<font color="#FFFFFF" style="font-size:
9pt"><%=var_user1%></font></td>
</tr>
<% rstActiveUsers.MoveNext
Loop
End If
%>

it shows names like this;

name1
name2
name3

what i would like it to do, is show like this, with 3 across

name1 name2 name3

i think i remember using a mod or something to pull this off.

can someone help??

TIA
Jeff
Mar 19 '07 #1
10 1367

"Jeff" <ba*@gig-gamers.comwrote in message
news:45***********************@roadrunner.com...
Hey gang.
I know this is probably an easy solution, but I don't remember how to do
it.

I have this code;

<%
If rstActiveUsers.RecordCount 0 Then
rstActiveUsers.MoveFirst
Do While Not rstActiveUsers.EOF
var_user1 = session("username") %>
<td class="tdblock" align="left">
<font color="#FFFFFF" style="font-size:
9pt"><%=var_user1%></font></td>
</tr>
<% rstActiveUsers.MoveNext
Loop
End If
%>

it shows names like this;

name1
name2
name3

what i would like it to do, is show like this, with 3 across

name1 name2 name3

i think i remember using a mod or something to pull this off.

can someone help??

TIA
Jeff
ok, along with this, i thought i had this working in the global.asa, but it
isn't.

i have this in the asa file:..

<object runat="Server" scope="Application"
id="rstActiveUsers" progid="ADODB.Recordset">
</object>

<script language="VBScript" runat="Server">

Sub Application_OnStart()

Const adInteger = 3
Const adVarChar = 200
Const adDate = 7

rstActiveUsers.Fields.Append "id", adInteger
rstActiveUsers.Fields.Append "ip", adVarChar, 15
rstActiveUsers.Fields.Append "browser", adVarChar, 255
rstActiveUsers.Fields.Append "started", adDate

rstActiveUsers.Open
End Sub

Sub Session_OnStart()

Session.Timeout = 20

Session("Start") = Now()

If Not rstActiveUsers.EOF Then rstActiveUsers.MoveLast

rstActiveUsers.AddNew

rstActiveUsers.Fields("id").Value = _
Session.SessionID

rstActiveUsers.Fields("ip").Value = _
Request.ServerVariables("REMOTE_HOST")

rstActiveUsers.Fields("browser").Value = _
Request.ServerVariables("HTTP_USER_AGENT")

rstActiveUsers.Fields("started").Value = _
Now()

rstActiveUsers.Update

End Sub

Sub Session_OnEnd()

Const adSearchForward = 1
Const adBookmarkFirst = 1
Const adAffectCurrent = 1

rstActiveUsers.Find "id = " & Session.SessionID, _
0, adSearchForward, adBookmarkFirst

If Not rstActiveUsers.EOF Then
rstActiveUsers.Delete adAffectCurrent
End If
End Sub

Sub Application_OnEnd()
rstActiveUsers.Close
End Sub
</script>
now what i don't have, and am unable to figure out, is how to get the actual
session usernames.

i have the cookie values as session("username") but i am unsure of where to
put that. i have searched the usual tutorial places, but i don't see where
to get that info.

if anyone can help, i would appreciate it.
at least point me to where i can find this.
Mar 19 '07 #2
Jeff wrote:
<object runat="Server" scope="Application"
id="rstActiveUsers" progid="ADODB.Recordset">
</object>
Bad ... no ... HORRIBLE idea. Do NOT store ADO objects in application or
session unless you have modified the server's registry to mark them
"free-threaded" (which will mean they cannot be used for Jet)
http://www.aspfaq.com/2053

Use an array or free-threaded XML document instead.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Mar 19 '07 #3
Jeff wrote:
<%
If rstActiveUsers.RecordCount 0 Then
I hope this recordset is disconnected and the connection closed ...
it shows names like this;

name1
name2
name3

what i would like it to do, is show like this, with 3 across

name1 name2 name3

i think i remember using a mod or something to pull this off.
Look, all you are doing in ASP code is generating a string of html
characters. With that in mind, start by creating the hetml that would
display the data as you desire. Then modify the vbscript code to generate
that html.

In this case, instead of writing cell and row end and start tags after each
record, you would write them after a set number of records. Yes, you could
use mod to do this:
if recordsprocessed % 3 =0 then
'write the end and beginning tags
end if
'write the data

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Mar 19 '07 #4
Bad ... no ... HORRIBLE idea. Do NOT store ADO objects in application or
session unless you have modified the server's registry to mark them
"free-threaded" (which will mean they cannot be used for Jet)
http://www.aspfaq.com/2053

Use an array or free-threaded XML document instead.
ok, say I am going to totally redo the asa file. Which I am currently
reading on it with the links you provided,
I still can't figure how to use the session("username") for anything in the
asa file. Unless I am missing something, I just don't get it.
Mar 19 '07 #5
Jeff wrote:
>Bad ... no ... HORRIBLE idea. Do NOT store ADO objects in
application or session unless you have modified the server's
registry to mark them "free-threaded" (which will mean they cannot
be used for Jet) http://www.aspfaq.com/2053

Use an array or free-threaded XML document instead.

ok, say I am going to totally redo the asa file. Which I am currently
reading on it with the links you provided,
I still can't figure how to use the session("username") for anything
in the asa file. Unless I am missing something, I just don't get it.
I didn't say anything about that because frankly I don't understand the
problem. A session variable contains nothing until you put something
into it. So you have to get the user name from a user and put it into
the session variable.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 19 '07 #6

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:e6**************@TK2MSFTNGP05.phx.gbl...
Jeff wrote:
>>Bad ... no ... HORRIBLE idea. Do NOT store ADO objects in
application or session unless you have modified the server's
registry to mark them "free-threaded" (which will mean they cannot
be used for Jet) http://www.aspfaq.com/2053

Use an array or free-threaded XML document instead.

ok, say I am going to totally redo the asa file. Which I am currently
reading on it with the links you provided,
I still can't figure how to use the session("username") for anything
in the asa file. Unless I am missing something, I just don't get it.

I didn't say anything about that because frankly I don't understand the
problem. A session variable contains nothing until you put something
into it. So you have to get the user name from a user and put it into
the session variable.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

correct. i do have the session variable ("username") as the login name of
the user. this gets assigned on the login page. the problem i am having, is
what to use on the asa page as the session("username") so i can work with it
there.

i guess i am not explaining myself to well.

Session.SessionID

that is the actual session id of the user.
Session.UserName
i know this isn't the session("username")
Mar 19 '07 #7
Jeff wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:e6**************@TK2MSFTNGP05.phx.gbl...
>Jeff wrote:
>>>Bad ... no ... HORRIBLE idea. Do NOT store ADO objects in
application or session unless you have modified the server's
registry to mark them "free-threaded" (which will mean they cannot
be used for Jet) http://www.aspfaq.com/2053

Use an array or free-threaded XML document instead.

ok, say I am going to totally redo the asa file. Which I am
currently reading on it with the links you provided,
I still can't figure how to use the session("username") for anything
in the asa file. Unless I am missing something, I just don't get it.

I didn't say anything about that because frankly I don't understand
the problem. A session variable contains nothing until you put
something into it. So you have to get the user name from a user and
put it into the session variable.
correct. i do have the session variable ("username") as the login
name of the user. this gets assigned on the login page. the problem i
am having, is what to use on the asa page as the session("username")
so i can work with it there.
You can't. What do you want to do with it in global.asa? There are only
4 event procedures that run in global.asa: application_onstart,
application_onend, session_onstart, and session_onend.
The session_onstart event runs BEFORE that login page runs. The user's
name does not exist at this point. You have to assign it into the
session variable at the point that the login page gets it from the user.
>
i guess i am not explaining myself to well.

Session.SessionID

that is the actual session id of the user.
True
>

Session.UserName
i know this isn't the session("username")
True.
Unless you are creating an intranet application that uses Windows
Authentication, the login name has to be gotten from the user.* Unless
you've stored it in a cookie on the user's machine (not very reliable),
it will not be available in global.asa ... and even then, I am not sure
that non-session cookies are available to global.asa. I don't have time
right now to look it up, but you can read through the documentation
here:
http://msdn.microsoft.com/library/en...f33a651779.asp

Bob Barrows

* If you ARE using Windows Authentication with Anonymous Access
disabled, the username can be found in
Request.SessionVariables("LOGON_USER")
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 19 '07 #8
You can't. What do you want to do with it in global.asa? There are only
4 event procedures that run in global.asa: application_onstart,
application_onend, session_onstart, and session_onend.
The session_onstart event runs BEFORE that login page runs. The user's
name does not exist at this point. You have to assign it into the
session variable at the point that the login page gets it from the user.
ok. then maybe i need to work this with a database. and grab the logon
username.

the only problem i can see, which may or may not be a problem, is removing
the name in the db once the session is closed.
i think i can write a code that checks the login time, and sets any name in
there to delete after the same time that the session expires.

Mar 19 '07 #9
Jeff wrote:
>You can't. What do you want to do with it in global.asa? There are
only 4 event procedures that run in global.asa: application_onstart,
application_onend, session_onstart, and session_onend.
The session_onstart event runs BEFORE that login page runs. The
user's name does not exist at this point. You have to assign it into
the session variable at the point that the login page gets it from
the user.

ok. then maybe i need to work this with a database. and grab the logon
username.

the only problem i can see, which may or may not be a problem, is
removing the name in the db once the session is closed.
i think i can write a code that checks the login time, and sets any
name in there to delete after the same time that the session expires.
Well, then, you will want to look at these articles:
http://www.aspfaq.com/show.asp?id=2491
http://classicasp.aspfaq.com/general...ion-onend.html

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 19 '07 #10
thanks Bob,

I really appreciate it
Mar 19 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
22
by: bearophile | last post by:
Ville Vainio: >It's highly typical for the newbies to suggest improvements to the >language. They will usually learn that they are wrong, but the >discussion that ensues can be fruitfull anyway...
21
by: Rabbit63 | last post by:
Hi: I want to show a set of records in the database table on the clicnt browser. I have two ways to do this (writen in JScript): 1.The first way is: <% var sql = "select firstname from...
6
by: Markus Dehmann | last post by:
I have n sets of elements. I want to find elements that occur more than once in more than one set. Maybe the following example shows what I mean: S1 = {1,2,3,2,4} S2 = {2,2,4,5,4} S2 =...
33
by: Joerg Schuster | last post by:
Hello, Python regular expressions must not have more than 100 capturing groups. The source code responsible for this reads as follows: # XXX: <fl> get rid of this limitation! if...
15
by: Deano | last post by:
I've posted about this subject before but haven't really got anywhere yet. I have now come up with a plan of action that takes into account my strong desire to implement save/discard functionality...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
15
by: sparks | last post by:
We get more and more data done in excel and then they want it imported into access. The data is just stupid....values of 1 to 5 we get a lot of 0's ok that alright but 1-jan ? we get colums...
3
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None...
7
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.