[Example] Computer Class

Mile-O

Back once again...
Local time
Today, 10:38
Joined
Dec 10, 2002
Messages
11,316
Computer Class

I've recently built a small Class Module that lets you know a "little" bit more about your users.

Properties include:

  • AccessDir: (string) - Returns the location of Access on the user's drive;
  • AccessVer: (string) - Returns the version of Access the user currently has installed;
  • ComputerName: (string) - Returns the network name of the user's computer;
  • Username: (string) - Returns the network login of the user;
  • IsRuntime: (boolean) - Returns whether Access version is Runtime or not;
  • OperatingSystem: (string) - Returns the operating system installed on the computer;
  • OSMajorVersion: (integer) - Returns the major version number of the operating system;
  • OSMinorVersion: (integer) - Returns the minor version number of the operating system;
  • OSServicePack: (string) - Returns the latest Service Pack installed on the computer;
  • ScreenResolution: (string) - Returns the current screen resolution;
  • TimeOffset: (long) - Returns the number of minutes the time settings are offset from UTC;
  • WinStarted: (long) - Returns the number of milliseconds that have passed since Windows was started;

All you need to so is simply import the two modules included into any database.

Enjoy...
 

Attachments

Last edited:
Thanks Mile!

How you get it to give you all that data I will never never know or understand even if you told me!!

Thanks for your hard work!!
 
Would you believe i have been working on more or less the same thing....?!?!?! Geez, could have saved me a bunch of work if you had posted this a week or so ago.... LOL

Good work Mile!
 
lol,

You got anything in yours that I don't have in mine; or vice versa

I was thinking of putting other things in like determining if a mouse, a mousewheel, a keyboard, etc, is attached, to name the default printer, list networks, and show diskspace.
 
P.S.

Did the TimeOffset work?

It's the only thing I couldn't test due to Control Panel restrictions in work. :mad:
 
Nu such luck, was doing UMT (or UTC) as well as Access installation folder. But was doing that thru the Registry:
Code:
Public Function AccessApp() As String
Dim objWord As Object

On Error GoTo AccessAppError

   Set objWord = CreateObject("Word.application")
   
   AccessApp = objWord.System.PrivateProfileString("", _
      "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Extensions", _
      "mdb")

AccessAppExit:
   objWord.Quit
   Exit Function

AccessAppError:
   MsgBox "Error No: " & Err.Number & "; Description: " & Err.Description
   Resume AccessAppExit
   
End Function
As well as other stuff on number checking like an 11 proof (dont know if you ever heard of that one!) and a social security number check.
Also i am trying to think up a better way of compacting rather than the Sendkeys solution.

Good "oldies" are computer/user name the computer started time is a nice one but wouldnt know a need for it right now... Just tinkering away i supose?!

Regards
 
Mile-O-Phile said:
P.S.

Did the TimeOffset work?

It's the only thing I couldn't test due to Control Panel restrictions in work. :mad:
The timeoffset works, i have the same code and works in NL US India UK and Aus... LOL

Editted to add: By the By, UMT i dont think that excists does it? UTC (Universal Time C--grrr something---) is the current name (or UT) used to be GMT (Greenwhich Mean Time or something like it). Military ppl will also call it Zulu Time (Z Time or ZT)

I also remember something about "Leap seconds" LOL
 
Last edited:
*GRMBL* forgot all about that one.... Can i delete that thread ???? LOL
 
namliam said:
By the By, UMT i dont think that excists does it? UTC (Universal Time C--grrr something---) is the current name (or UT) used to be GMT (Greenwhich Mean Time or something like it). Military ppl will also call it Zulu Time (Z Time or ZT)

Yeah, I meant UTC. :rolleyes:
 
I also ripped together some code so i can have a check against a windows server so see if some UserID/PW is valid inside a given domain. Really cool :)
 
namliam said:
the computer started time is a nice one but wouldnt know a need for it right now...

As the property WinStarted is just the number of milliseconds elapsed since Windows was started ( the actual time was done with DateAdd() ) you can use it to calculate the time elapsed in doing something.

i.e.

Assign Long to Variable1
Perform an operation
Assign Long to Variable2
Subtract Variable1 from Variable2
You have the number of milliseconds it takes to perform an operation.
 
Yep thats a nice one.... As well as having this forum (just about) all to the 2 of us... :)

I was working at a customer the other day. Their times would stall on a running computer, as specially when running heavy dutty procedures like i am likely to make/test/run. I had procedures that took over 3 hours at a time to run. But only showing 5 to 10 mins on the computer clock. On that computer my workday would only be an hour or so.... LOL Then where are you with your timing... Geez... It seems like i can find something wrong with just about anything cant I????

I am just about to "close up shop" for Xmass. So see you around i hope....

Regards
 
Another idea, Connected to server(name)...

1 mad man can ask more questions than 10 wisemen can answer ;)

Regards
 
namliam said:
Another idea, Connected to server(name)...

Yep, that's possible. And all the different drives on the server, etc.
 
Hey Mile, As a newly crowned modetator, (Congrats) has there been any thought given to a seperate forum for code examples and downloads as you are developing here. Seems a lot of questions get asked over and over without users utilising the search engine.
I seemed to have posted that image sample soooo many times.
Dave
 

Users who are viewing this thread

Back
Top Bottom