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.
MehramAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MehramAuthor Commented:
Thank you I am checking and reverting back.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.