473,434 Members | 1,738 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,434 software developers and data experts.

Log file

52
hi,
i'd like to create a log file..
There is one form that has a list box where it shows all the login and logout times.

Code for Form load
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. '
  3. Dim dbmyDB As Database
  4. Dim rsmyRS As Recordset
  5.  
  6.   Set dbmyDB = OpenDatabase("E:\skol\A2 Computing\Speedy Pizza database.mdb")
  7.     Set rsmyRS = dbmyDB.OpenRecordset("Log file", dbOpenDynaset)
  8.  
  9. If Not rsmyRS.EOF Then rsmyRS.MoveFirst
  10.  
  11. Do While Not rsmyRS.EOF
  12.     List1.AddItem rsmyRS!Log
  13.     List1.ItemData(List1.NewIndex) = rsmyRS!Log
  14.     rsmyRS.MoveNext
  15. Loop
  16. rsmyRS.AddNew
  17. List1.Text = rsmyRS!Log
  18. rsmyRS.Update
  19. End Sub
  20.  
  21. Listbox code
  22. Private Sub List1_Click()
  23. rsmyRS.FindFirst "Log=" & (List1.ItemData(List1.ListIndex))
  24.  
  25. List1.Text = rsmyRS!Log
  26. End Sub
  27.  
the way the times are entered is when the user logs in i additem "login time the date and time " and when the user logs out the same thing but logout instead of login. when the user logs out the data should be saved. my problem is that it either saves it but field is empty in access or an array problem. so i ain't bothered with my coding. i was hoping if anyone can suggest a code that may work. please

Thank YoU
Feb 26 '08 #1
3 1172
VBWheaties
145 100+
i'd like to create a log file...
You should make rsmyRS global if you are going to use it in several places. It looks like its dimmed at form load only.
Feb 26 '08 #2
debasisdas
8,127 Expert 4TB
If you are storing login and logout in the same table then when the user logs out you must update the database. But your code does not do anything like that. What you have is only form load.
Feb 27 '08 #3
daniel aristidou
491 256MB
Also its possible to keep a record of only the count of logins the last login and log out using the registry,,,,
This would enable you to make sure nobody has deleted anything form the table...
Feb 27 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
3
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
0
by: troutbum | last post by:
I am experiencing problems when one user has a document open through a share pointing to the web site. I use the dsolefile to read the contents of a particular directory and then display them in a...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.