Hi all: I know this is not strictly Linux related but I could use some help. I have a student who is working on a project for the AS ICT in Access (sorry to swear). He has a working log on system using a query but would like to make a .txt file of all the people that log on and have it update (like a security log). I assume this involves some VB which I am not au fait with at all. Any help would be greatly appreciated. BTW, the specifications, at least for AQA I'm not sure about other boards, though not explicit do force students down the MS route. I am in the process of challenging this as I would like to use MySQL as I get more familiar with it. TIA Paul
----- Original Message -----
I know this is not strictly Linux related but I could use some help. I have a student who is working on a project for the AS ICT in Access (sorry to swear). He has a working log on system using a query but would like to make a .txt file of all the people that log on and have it update (like a security log). I assume this involves some VB which I am not au fait with at all. Any help would be greatly appreciated. BTW, the specifications, at least for AQA I'm not sure about other boards, though not explicit do force students down the MS route. I am in the process of challenging this as I would like to use MySQL as I get more familiar with it.
OK. Why a .txt file? What's wrong with a table? Ideally, the data and "programs" should be separated. There is no reason not to have a three .mdb structure: program.mdb, data.mdb, security.mdb. Using a table, it's fairly simple. You have a password form. When you click the logon button, the on click event does a dlookup in the password table to find the stored password and compares it to the entered password. The next bit is piece of vbcode to open the log table, goto a new record and set the username and time and save the record. dim rstLog set rstLog=currentdb("tblLog") with rstLog .addnew !UserName=me!tbUser 'name of box on form for username !StartDate=now .update end with Using a .txt file, it's much the same. This bit is nicked from the help file Sub OpenTextFileTest Const ForReading = 1, ForWriting = 2, ForAppending = 3 Dim fs, f Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile("c:\testfile.txt", ForAppending,TristateFalse) f.Write "Hello world!" f.Close End Sub OK The advantage of a table is that it is easier to log a user out. If you have a true multi-user situation then you may have several users logged in at the same time. If you use a simple text file, then you have to create records of the form User,Date/Time, In/Out or do a lot of file mangling to create a file with proper records. Next point. Yes the boards do force students down the MS route, particularly for ICT. No problem here. The point is that ICT people are managers not users i.e. they need to know what is possible not how. They need to be able to make commercial decisions based on what a techie tells them. Getting their hands dirty is not especially useful. For most schools, MS is good enough. We do need to tell them that there is a viable alternative. This e-mail is intended for the addressee shown. It contains information that is confidential and protected from disclosure. Any review, dissemination or use of this transmission or its contents by persons or unauthorized employees of the intended organisations is strictly prohibited. The contents of this email do not necessarily represent the views or policies of East Norfolk Sixth Form College, its employees or students.
participants (2)
-
manager
-
ptaylor