|
||||||
| Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I want to ask for help for creating an activity logfie for example if the client delete data from the database,it will written to the logfile at what time he/she delete the data etc.Also i want to ask,is it possible to read ip and write it to log file from the client if the application was only installed on the server side,but the application was used by 3 clients?Thanks a lot.
|
| Sponsored Links |
|
|
|
|||
|
Hi yonghan,
For creating a log, you could open a file for output and print the information to it as it passes various parts of the application. Code:
'-- Open a file for output --| Open "c:\access.log" for output as #1 ................. ................. ................. '-- Set a variable to hold the text going into the log file --| strTemp = << stuff to go into the log file >> '-- Send variable into the log file --| Print #1, strTemp ................. ................. '-- And at the end, close the file --| Close #1 If the client is accessing the server via Winsock (if the application is a Windows based app rather than a web application on a website), then you could get the users IP via the Winsock object on the server form... a la Winsock1.RemoteHostIP (if I remember right?) And you can write that to the log file in the same way as above ![]() |
|
|||
|
i'm using vb 6.I'm intending to make a log for the clients activity for example delete data etc.So the owner know what had happen..Are there any reference about winsock using vb 6??Thanks..
|
| Sponsored Links |
|
|
|
|||
|
The application was putted on the server,the clients are using it..Some sort of creating a shortcut to the application i suppose..Is it possible to get the clients ip that access the application??thanks..
|
|
|||
|
For creating a log, the code I provided will work fine - I use it myself for the same purpose in another application I've made in the past.
Quote:
From the quote I've included, it seems as though there is only one application which is kept on the server which I wouldn't know how to get the client's IP address from ![]() |
|
|||
|
Ok,thanks..I also want to ask for help again..I wrote a function to add data to access.I'm intending to store the sold goods into it,and check when a transaction was made,are there the same date,code,name of the goods.If there are same,then the quantity field will be updated..I create it to see the most sold goods..Here are the codes..Please help me to check it..Or are there another way to get the most sold goods??Thanks..
Private Sub terlaku() Dim a, Jumlah As Integer Dim kode As String For a = txtKode.LBound To txtKode.UBound If txtKode(a).Text <> "" Then If txtQty(a).Text <> "" Then kode = txtKode(a).Text rsterlaku.AddNew rsterlaku!ID = CStr(Date) & " - " & strUser rsterlaku!tgl = Date rsterlaku!kd_brg = txtKode(a).Text rsterlaku!nm_brg = txtNama(a).Text rsterlaku!Qty = txtQty(a).Text rsterlaku!User = strUser rsterlaku!Update = Now If rsterlaku.RecordCount > 0 Then rsterlaku.MoveFirst rsterlaku.Index = "tgl" rsterlaku.Seek "=", Date If Not rsterlaku.NoMatch Then rsterlaku.Index = "kd_brg" rsterlaku.Seek "=", kode If Not rsterlaku.NoMatch Then rsterlaku.Index = "user" rsterlaku.Seek "=", lbluser.Caption If Not rsterlaku.NoMatch Then Jumlah = CInt(rsterlaku!Qty) rsterlaku.Edit rsterlaku!Qty = CStr(Jumlah + CInt(rsterlaku!Qty)) rsterlaku!User = strUser rsterlaku!Update = Now Else If rsterlaku.NoMatch Then rsterlaku.AddNew rsterlaku!ID = CStr(Date) & " - " & strUser rsterlaku!tgl = Date rsterlaku!kd_brg = txtKode(a).Text rsterlaku!nm_brg = txtNama(a).Text rsterlaku!Qty = txtQty(a).Text rsterlaku!User = strUser rsterlaku!Update = Now End If End If End If End If End If End If End If rsterlaku.Update Next a End Sub |
|
|||
|
Private Sub terlaku()
Dim a, Jumlah As Integer Dim kode As String For a = txtKode.LBound To txtKode.UBound If txtKode(a).Text <> "" Then If txtQty(a).Text <> "" Then kode = txtKode(a).Text rsterlaku.AddNew rsterlaku!ID = CStr(Date) & " - " & strUser rsterlaku!tgl = Date rsterlaku!kd_brg = txtKode(a).Text rsterlaku!nm_brg = txtNama(a).Text rsterlaku!Qty = txtQty(a).Text rsterlaku!User = strUser rsterlaku!Update = Now If rsterlaku.RecordCount > 0 Then rsterlaku.MoveFirst rsterlaku.Index = "tgl" rsterlaku.Seek "=", Date If Not rsterlaku.NoMatch Then rsterlaku.Index = "kd_brg" rsterlaku.Seek "=", kode If Not rsterlaku.NoMatch Then rsterlaku.Index = "user" rsterlaku.Seek "=", lbluser.Caption If Not rsterlaku.NoMatch Then Jumlah = CInt(rsterlaku!Qty) rsterlaku.Edit rsterlaku!Qty = CStr(Jumlah + CInt(rsterlaku!Qty)) rsterlaku!User = strUser rsterlaku!Update = Now Else If rsterlaku.NoMatch Then rsterlaku.AddNew rsterlaku!ID = CStr(Date) & " - " & strUser rsterlaku!tgl = Date rsterlaku!kd_brg = txtKode(a).Text rsterlaku!nm_brg = txtNama(a).Text rsterlaku!Qty = txtQty(a).Text rsterlaku!User = strUser rsterlaku!Update = Now End If End If End If End If End If End If End If rsterlaku.Update Next a End Sub |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows XP Tricks & Tips!!!!..new ones. | pranky | Tutorials | 9 | 08-23-2008 04:22 PM |
| Visual Studio 2008: C# Reading Files | Jordan | CSharp Tutorials | 8 | 06-20-2008 11:54 AM |
| Windows Shortcut List - Saves Time | 2stamlers | The Lounge | 6 | 04-10-2008 07:58 AM |
| How to create a text file on my host and save the input of my form there ? | kresh7 | Visual Basic Programming | 2 | 11-27-2007 04:00 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |