[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2100
  • Last Modified:

Swap card machine

I want to design attendance application with help of Swap card machine through USB Port. But the confusion is that how the data will be entering into MYSQL for out or in time. My employee code is base on 4 digits.

I am using VB 6 as front end and MYSQL as backend and I would request you to please guide how data can enter into database through swap machine.
0
Mehram
Asked:
Mehram
  • 2
  • 2
1 Solution
 
csgeekpyroCommented:
I'm not a VB coder, but I can give you a general idea of how I would do this:

2 tables, an activity log, and a status table.  When someone swipes the card, I assume your card reader gives you some unique ID cooresponding to that card.

if( ID in statustable)
  if( status = in )
    set status = out
    log change in activity table
  else
    set status = out
    log change in activity table
else
  add ID to statustable with status = in
  log change in activity table

The status table will map ID->status
The log table will map ID->status changes (out->in/in->out) if you so desire to keep this information.
0
 
abdulhameedsCommented:
you can use text file when you do all the transaction in file outside the visual basic then you can import it to your application

you need to use Status Flag to check the in out for each employee

0
 
csgeekpyroCommented:
I just spotted an error in my pseudocode back there.  it should read:

if( ID in statustable)
  if( status = in )
    set status = out
    log change in activity table
  else
    set status = in
    log change in activity table
else
  add ID to statustable with status = in
  log change in activity table
0
 
abdulhameedsCommented:
function  FillExits(eno as string ) as string
Dim RS As Recordset
Dim SQL As String
Set RS = New Recordset
SQL = "select * from empWorks where empno='" & Combo1.Text & "' and edate=# " & Format(Date, "mm/dd/yyyy") & " #"
RS.Open SQL, db, adOpenKeyset, adLockOptimistic
If RS.RecordCount > 0 Then
    RS.MoveLast
Fillexits=  rs!status
End If
end function


'in form
if  FillExits="IN" then
'do your command
elseif FillExits="out" then
'do your command
end if
0
 
MehramAuthor Commented:
Thank you I am checking and reverting back.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now