How to prevent a user from logging in twice.

Posted on behalf of Zen Bodhi.

Hello guys,
I am raising this same subject again because my question is related to this subject.

Is there any way to display Database Sessions sorted by UserID?

Please helps.

By the way, I don’t see Nils in this forum lately. Hopes he is doing alright.

A solution for this is posted somewhere on mibuso. Let me search…[:)]

Found it

Hi Zen… of course I am still around…[:D]
though as you mention not that active yet, but that’ll change again…


Zen actually posted this onMBSOnline this morning, I just moved it here and send him a message to join us here. It looks like there ar e still many people that have not found us here yet.

I got that one Mark but my question is how to sort database session by User ID.



Not in Navision I don’t think. You need a key on that field, and since the session table is a virtual one you can’t add it. You could write some functionality that retrieves it from SQL Server using an ADO object, or maybe create a custom table that you populate with all active sessions upon opening the form or something, and then you can slice and dice.

Hhm…alright then. Thank you Daniel.


Its not all that hard to sort a virtual table. The easiest is to use a different table to do the sorting wth, in this case, you could for instance use say Item.

So create a Temp Record of Item, create aloop that goes though sessions, and popuates as follows

Item … Session
No. = format(session id)
Search Name = User Name
commission group = session id.
item.insert etc…

at the same time populate a temp rec of sessions.

then just create a new sessions form that opens with item rec as source, and sort by search name. then

on next rec etc just do a
Tempsession.get(tempitem.commision group);


Now I wouldnever recommend this for normal business use, but since its just an it tool, and not business critical it shoudl be fine.

Of course don’t go and delte all your items by accident, that would not be nice.

Thank you David.


You are wlecome, sorry if its a bit hard to follow, I was in a hurry.

I think there is a key for UserID on the sessions database, at least you can go File >> Database >> Information >> Current Sessions and then sort by userID.


[*-)] Are you sure? Since when and in which version? [8-)]

I know that this is availible in version 4 Onwards, have not checked any earlier versions.

The only key is the Connection ID

I see the key! Wow, all this time I did not know it was there and never bothered to check. A lot of other keys to sort on as well that seem ultra useful, including the Blocking fields. But, only on the SQL version it seems. Awesome. Thanks for the tip!

It is in SQL GB3.7 with quite a few other keys including blocked and blocking user ID Is SQL the factor?


It is in SQL GB3.7 with quite a few other keys including blocked and blocking user ID Is SQL the factor?


SOrry, I only brought over a part of the thread, so you couldn’t have known that Zen is on 3.70 C/SIDE, my answer was based on already knowing that. [:$]

PS another reason to update your profiles people !

Yes I see it now too. Cool you learn something new every day, thanks for the tip. I have all my databases on SQL Server, so I’d have to check out C/SIDE.