473,804 Members | 2,986 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("userna me") %>
<td class="tdblock" align="left">
<font color="#FFFFFF" style="font-size:
9pt"><%=var_use r1%></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 1389

"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("userna me") %>
<td class="tdblock" align="left">
<font color="#FFFFFF" style="font-size:
9pt"><%=var_use r1%></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="Applicat ion"
id="rstActiveUs ers" progid="ADODB.R ecordset">
</object>

<script language="VBScr ipt" runat="Server">

Sub Application_OnS tart()

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").Va lue = _
Session.Session ID

rstActiveUsers. Fields("ip").Va lue = _
Request.ServerV ariables("REMOT E_HOST")

rstActiveUsers. Fields("browser ").Value = _
Request.ServerV ariables("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.Session ID, _
0, adSearchForward , adBookmarkFirst

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

Sub Application_OnE nd()
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("userna me") 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="Applicat ion"
id="rstActiveUs ers" progid="ADODB.R ecordset">
</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 recordsprocesse d % 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("userna me") 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("userna me") 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******@NOyah oo.SPAMcomwrote in message
news:e6******** ******@TK2MSFTN GP05.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("userna me") 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("userna me") so i can work with it
there.

i guess i am not explaining myself to well.

Session.Session ID

that is the actual session id of the user.
Session.UserNam e
i know this isn't the session("userna me")
Mar 19 '07 #7
Jeff wrote:
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:e6******** ******@TK2MSFTN GP05.phx.gbl...
>Jeff wrote:
>>>Bad ... no ... HORRIBLE idea. Do NOT store ADO objects in
applicatio n 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("userna me") 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("userna me")
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_ons tart,
application_one nd, 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.Session ID

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

Session.UserNam e
i know this isn't the session("userna me")
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.Session Variables("LOGO N_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_ons tart,
application_one nd, 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_ons tart,
application_on end, 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

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

Similar topics

303
17801
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. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
22
2337
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 :-). Few more notes on the language. I don't know if I can really suggest improvements to the language... but I hope to learn something :-) I think some things are better in Delphi/Pascal (like the := for assignments instead of = and = for...
21
3925
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 table1"; var obj=new ActiveXObject("ADODB.Recordset");
6
1707
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 = {2,5,2} The algorithm should find that the "2" occurs more than once in S1, S2, and
33
5655
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 p.pattern.groups > 100: raise AssertionError( "sorry, but this version only supports 100 named groups"
15
1663
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 on all key forms. The first thing to do is to successfully split the database. I then rewrite to support multiple users. To allow the save/discard feature I create copies of the key tables and append the word Final to each one. For example I...
2
2598
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 good while and I'm getting really frustrated now! My problem is this - my custom controls periodically disappear from my
15
2437
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 that are formatted for number and then half way down they are changed to text. OR the famous ok now everything in red is ---- and everything in blue is---------. WTF are these people thinking?
3
2962
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 of the script gets executed. Can someone please give me a direction as to what I may be missing? Thanks.
7
7821
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}" As far as I know yet -- hence this question -- there is no 'one solution fits all', but instead there are several parts that have to be put together to check. What I have so far is, and would like as much feedback as possible to ensure I've...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9152
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.