Getting machine name when connecting to db

We have an application in Access 2000, front end/back end design,10-12 users.  I want to save the dates and times they enter and exitfrom the app from their workstations in a table in the back end.How do I get the name of their workstation to save to that table?  Theworkstations have names like "sales1", "sales2", "Reception", etc.Paul Fenton
0
Paul
3/16/2007 7:36:25 PM
access 16762 articles. 3 followers. Follow

5 Replies
757 Views

Similar Articles

[PageSpeed] 17

Add error handling as required. Place in a module and call functionwhen needed.'example by Donavon Kuhn (Donavon.Kuhn@Nextel.com)Private Const MAX_COMPUTERNAME_LENGTH As Long = 31Private Declare Function GetComputerName Lib "kernel32" Alias"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As LongFunction GetMachineName() As String    Dim dwLen As Long    Dim strString As String    'Create a buffer    dwLen = MAX_COMPUTERNAME_LENGTH + 1    strString = String(dwLen, "X")    'Get the computer name    GetComputerName strString, dwLen    'get only the actual data    GetMachineName = Left(strString, dwLen)End Sub
0
storrboy
3/16/2007 7:47:30 PM
Thank you storrboy, that works.Paul FentonOn 16 Mar 2007 12:47:30 -0700, "storrboy" <storrboy@sympatico.ca>wrote:>>Add error handling as required. Place in a module and call function>when needed.>>>'example by Donavon Kuhn (Donavon.Kuhn@Nextel.com)>Private Const MAX_COMPUTERNAME_LENGTH As Long = 31>Private Declare Function GetComputerName Lib "kernel32" Alias>"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long>>Function GetMachineName() As String>    Dim dwLen As Long>    Dim strString As String>    'Create a buffer>    dwLen = MAX_COMPUTERNAME_LENGTH + 1>    strString = String(dwLen, "X")>    'Get the computer name>    GetComputerName strString, dwLen>    'get only the actual data>    GetMachineName = Left(strString, dwLen)>End Sub
0
Paul
3/16/2007 8:22:46 PM
SUSER_SNAME() works great in Access Data Projectsthen you can practice SafeSex and you don't cut and paste the firstrandom API call that joe nobody feeds to you-TodosOn Mar 16, 12:36 pm, Paul Fenton <pfen...@NOSPAMplgassociates.com>wrote:> We have an application in Access 2000, front end/back end design,> 10-12 users.  I want to save the dates and times they enter and exit> from the app from their workstations in a table in the back end.>> How do I get the name of their workstation to save to that table?  The> workstations have names like "sales1", "sales2", "Reception", etc.>> Paul Fenton
0
Todos
3/17/2007 12:45:58 AM
"Todos Menos [MSFT]" <todos_menos_msft@hotmail.com> wrote:Todos Menos is not a Microsoft employee.  This posting is by A a r o nK e m p f.Tony-- Tony Toews, Microsoft Access MVP   Please respond only in the newsgroups so that others can read the entire thread of messages.   Microsoft Access Links, Hints, Tips & Accounting Systems at http://www.granite.ab.ca/accsmstr.htm
0
Tony
3/17/2007 1:24:24 AM
> then you can practice SafeSex and you don't cut and paste the first> random API call that joe nobody feeds to youROFLMAO!  I know that user.  He used to hang out in the old VB6 groups.-- Peace & happy computing,Mike Labosh, MCSD MCTOwner, vbSensei.Com"Escriba coda ergo sum." -- vbSensei
0
Mike
3/17/2007 3:35:18 AM
Reply:

Similar Artilces:

how do I get outlook to go online?
I can't seem to find an answer to my problem. I have installed Microsoft Outlook 2003 but everytime I click on it it says it cannot find a connection to the internet even though I am CONNECTED! Do I have to subscribe to something? Can someone please help. I am fast giving up on Outlook. Thanx. What kind of e-mail account are you using and how did you set it up? -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please reply only to the newsgroup to preserve the message thread. *** "Res" wrote: > I can't seem to ...

Getting appts to print on one page
I am using calendar assistant to print multiple overlaid calendars at once on letter size paper. All the appointments show up on the first page, except for one. This one pushes to a second monthly page duplicating the first. ie - I get two November 2009s - one with all appts except one and the other page with only the one rogue appointment -- Thanks, Alison ...

Outlook 2002-can't reply. Get "undeliverable" from System Administrator
When I reply, I am getting the mail bounced back with the message: "Undeliverable: Subject of email" from the System Administrator. This is happening to most but not all emails. When I called my ISP, they said it was an Outlook glitch and that I should uninstall and then reinstall Outlook. Any other suggestions? If not, if I uninstall Outlook, will all my data be saved? Thanks, Wendy What is the complete error message? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the SWEN virus, all mail sent to my personal account ...

OWA
SBS 2003 SP1, Exch 2003 SP2, FBA w/ SSL. If I add/delete a calendar event via OWA, I get a 5.1.7 NDR in my Inbox (pasted below). The calendar item is added/delete, and I see it in OWA or Outlook. I haven't seen any other posts similar to this, nothing on MS support. Any clues? ========== Your message did not reach some or all of the intended recipients. Subject: Sent: 12/21/2006 8:24 AM The following recipient(s) could not be reached: System Attendant on 12/21/2006 8:24 AM The e-mail address could not be found. Perhaps the recipient moved to a different e-mail organization, or t...

Unable to get DxgkDdiRecommendFunctionalVidPn call in windows 7
I am trying to add an initial vidpn topology by implementing the DxgkDdiRecommendFunctionalVidPn call in the WDDM miniport driver. But starting from windows 7 i am unable to get the DxgkDdiRecommendFunctionalVidPn function call from dxgkrnl.After searching through the MSDN documentation i found out that the function is deprecated starting from windows 7. msdn link: http://msdn.microsoft.com/en-us/library/ee220395.aspx According to msdn "On a computer running Windows 7, the display mode manager (DMM) determines an appropriate VidPN topology to apply using VidPN history d...

HELP!!! Can't get forumla figured out!
Hello, This is my first posting to this forum, and I haven't been able to search using the right criteria (not even sure what I would search under) to find what I need so I thought I would post a thread with the question. I have an access query that gives me the results in a spreadsheet layout, with 2 worksheets on it. I need to create a forumla that will look at the data on the 2nd sheet and compare the values in 2 particular columns with the value in one cell on the 1st sheet and populate a different cell on the 1st sheet with a count of entries from the 2nd sheet. If Sheet B, Colu...

Excel user name
A while ago there was a thread here asking about excel user names - cant find it now but id like to know how i can create a MSGBOX that ca use names - for example the macro reads the excel user name, vlookup short (nick) name, then gives a more personalised message. Can anyone help? Thank -- Message posted from http://www.ExcelForum.com Hi msgbox application.username -- Regards Frank Kabel Frankfurt, Germany "LB79 >" <<LB79.1axkrc@excelforum-nospam.com> schrieb im Newsbeitrag news:LB79.1axkrc@excelforum-nospam.com... > A while ago there was a thread here askin...

IS size vs EDB file size?? I don't get it!!
I am using Standard version of Ex 5.5. I realize the 16gig limit. My question is I have added up the Kbyte in Ex Admin and it does not come close to the actual size of the priv.edb file. I have done an offline defrag also but did not get any amount of space back. I have been through the MS knowledge base and have read the articles on this subject. The kbyte size is 1.6gig and my edb file size is 14.1gig. What is using over 12gig of space??? Any ideas would be very much appreciated. I don't have 12gig of rules as the MS knowledgebase suggests. "Orlando" <Oplasencia@tp...

get/change first operation on table 'uprEmployeeCount' failed
I created a 'test' company on V10, restored the backup from our real company into this test company. I have inactivated all the employees in the test company. Unless I enter Dynamics as sa, I get the following message: A get/change first operation on table 'uprEmployeeCount' failed accessing SQL Data. Under the more info button: [Microsoft][ODBC SQL Server Drive][SQL Server] The EXECUTE permission was denied on the object 'zDP_UPR41600F_1',database 'DYNAMICS', schemo 'dbo'. I have deleted the UPR41600 table and recreated it but I still get the...

Can't get my Focus
I have a form(frmProducts) on a tab control object (TabClt) that is on another form(frmOrders). I have a search box on frmProducts that filters "On change" and then keeps its focus in that box. Private Sub txtDescSearch_Change() DoCmd.ShowAllRecords Me.Filter = "Description like '" & txtDescSearch & "*'" Me.FilterOn = True Me.txtDescSearch.SetFocus SendKeys "{F2}" End Sub It works fine when I open frmProducts by itself but when I open the tab it is on from frmOrders. When I enter the first search letter it does fi...

Connectivity Problems
Sorry about the length of this post, but I have no idea what I'm talking about, let alone explain it! We have two sites (Head Office and Remote) with a Netgear FVS338 VPN firewall at each end. The remote site connects via a Terminal Server and runs a couple of EPOS systems. Our setup in the Head Office is thus: Workstation -> SBS 2003 R2 Standard -> FVS338 VPN Firewall -> Internet Router Recently, the VPN keeps dropping and if I set up a permanent ping I can see that several times a day we get 7 or 8 pings timing out. This is enough to kill the EPOS connect...

HELP SCREENS, can't get help..
HELP SCREENS, can't get help.. 100723 1900 no pun.. can't get help on how to turn off "TILE" windows if using the term correctly. had seen setting somewhere, to stop Excel from minimizing to a narrow window when help opens (how the heck supposed to compare help to work doing when reducing window on us: cannot read window). where is the setting to stop windows / excel help from resizing to a narrow screen, when you open help. Top left of the help window autotile icon (looks like double page). It toggles between the help andexcel windows being tiled and vo...

User Name prompts
Hi, I am using Microsoft Outlook 2002 and have a two word username separated by a space. I have been having this problem with Outlook wherein I have entered my username and password in the account setup process, but it still prompts me for it whenever it is checking for new messages. Also, when it prompts, it shows the username without the space. Does Outlook not accept usernames with space, because I tried changing the original settings many times, but every time I open the Edit window of email accounts, I see my user name without space. ...

how do I have contacts and companies name is tasks
I'm new to outlook, When I create field chooser and have the Company Name & Contact name in fields Sometimes both Company name & Contact name shows up when I schedule a task. (That is what I want) However most of the time only the contact name shows up??? and no Company Name? Does anyone know why this is inconsistant? And How I can display both all the time? Thanks in advance Mike iselltape@cox.net ...

a document has gone in compatibility mode how do I get it back
I lost a couple of documents that I had saved and was changing the saved title and as I have said the document has gone into compatibility and I cant get it back. ...

How to get total "conditional sum of cells" in a column?
Hi all, I have dollar amounts in one col, and status in another. I want the sum of those dollar amounts where the corresponding status cell is empty (blank). How do I do this? Thanks for any hints, cdj Status in Column A and dollar amounts in Column B: =SUMPRODUCT((A2:A100="")*B2:B100) -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings sandymann2@mailinator.com Replace @mailinator.com with @tiscali.co.uk "sherifffruitfly" <sherifffruitfly@gmail.com> wrote in message news:bc08584b-1338-4b3f-8ab3-cc3e1602e581@n1g2000prb.go...

how field name output same as input
Thanks for any help. I have a query from a couple tables, and one of the field names in the table is 'IGP' and I have a field in the query that was IGP and now I changed to IGP: iif(blah IGP blah) which gives me a circular error. The table is used by a bunch of other things, so I don't want to change the field name there, and the field name for the output is used by a bunch of things, so nor do I want to change the name there. I am using Access 2007. I thought about changing the output field to IGP_, and I could change the embedded queries in Excel that use it, but...

To auto-fill using names no longer in address
Is there a way to remove the names for the auto fill feature that are no longer in the address book or contact list? If they are selected the properties for the entry states name is no longer valid Address Book entry. Thanks. State your Outlook version and what you mean by "autofill." Outlook has two different functions this could be: autoresolution or autocompletion. -- Russ Valentine [MVP-Outlook] "Ernie C" <anonymous@discussions.microsoft.com> wrote in message news:04e601c4913a$f07a15c0$7d02280a@phx.gbl... > Is there a way to remove the names for the au...

Outlook/Inaccurate Check Names Resolve
I currently have Outlook 2002 with Exchange 2000 and am in a network environment. I've noticed that if I modify an existing contact to reflect perhaps a new email address, when I compose a message in Outlook and use the check names feature, where it populates my TO field automatically by typing a few of the letters of the name, it pops in the old address of that contact, even though I've modified it to the new address. Also, if the few letters that I type match a few different contact names, a suggestion list comes up and the incorrect (old) address for this person is also ...

create a report using vba to select the names for the report
Hi, I need to create a report of selected Customers, I have gone as far as creating a string with customer names in it. Whats next? sample = Selected_Customer_Names= [ABC], [test], [New], [A New One] ...... and so on. Is this correct for the report and/or how do i open the report with the above only listed? -- Message posted via http://www.accessmonster.com On Wed, 28 Apr 2010 03:47:34 GMT, "trevorC via AccessMonster.com" <u44860@uwe> wrote: >Hi, >I need to create a report of selected Customers, I have gone as far as >creating a string with ...

Delay after connecting w/ RPC over HTTPS
My users can connect using RPC over HTTPS, but there is an irritating one-minute delay after the connection is made, during which Outlook shows "Connected" in the bottom-right info box and "Waiting to update this folder." This happens EVERY time we connect, even if we've disconnected moments before. Is this normal? If not, any ideas? On 22 Jun 2006 08:59:35 -0700, maximum@cheerful.com wrote: >My users can connect using RPC over HTTPS, but there is an irritating >one-minute delay after the connection is made, during which Outlook >shows "Connected&quo...

Can get UserProperty Names but not Values?
>From C++ using UserProp->Name I can get the name of a UserProperty, but UserProp->Value.bstrVal always returns nothing, anyone have any ideas what I could be doing wrong and has anyone ever accessed UserProperties from C++? UserPropertiesPtr UserProps = Con->UserProperties; if (UserProps->Count > 0) { tot = UserProps->Count; UserPropertyPtr UserProp; for (i=1;i < tot + 1;i++) { UserProp = UserProps->Item(i); MessageBox(NULL,UserProp->Name,"Test - Name",MB_OK); char* sText; sText = (char*)UserProp->Val...

Getting machine name when connecting to db
We have an application in Access 2000, front end/back end design,10-12 users. I want to save the dates and times they enter and exitfrom the app from their workstations in a table in the back end.How do I get the name of their workstation to save to that table? Theworkstations have names like "sales1", "sales2", "Reception", etc.Paul Fenton Add error handling as required. Place in a module and call functionwhen needed.'example by Donavon Kuhn (Donavon.Kuhn@Nextel.com)Private Const MAX_COMPUTERNAME_LENGTH As Long = 31Private Declare Function GetComputerName L...

Sort column with first and last name by last name
Hello, I have a mailing list with 10,000 names. The first cell has first an last name in the same cell. First name is listed first. Is there formula to sort and/or separate text in a cell. I would like to sort o separate the first name from the last in the cell to allow for a mai merge by name. Using Excel 2002. Thank you -- Message posted from http://www.ExcelForum.com If you have just first and last names separated by a space, Data>Text to Columns would be the easiest method to split into two columns. If more than that, like names with van or von or de etc. you may need a different m...

Domain name issue migrating 5.5 to Exchange 2003
We are prepairing to migrate Echange 5.5 to Exchange 2003. This has come up as an issue: Our domain is cornerstone instead of cornerstone.com Our email address is "firstname.lastname@cornerstonegrp.com" instead of: "firstname.lastname@cornerstone.com" ...