Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,247 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,215 people online right now. Registration is fast and FREE... Join Now!




thumbprint image retrieval using visual basic 6.0

 
Reply to this topicStart new topic

thumbprint image retrieval using visual basic 6.0, how can i detect the image from thumbprint scanner and save to databas

heavolk
14 Oct, 2008 - 06:28 AM
Post #1

New D.I.C Head
*

Joined: 27 Aug, 2008
Posts: 3

i have a digitalpersona fingerprint scanner and i need to scan thumbprint...
is anybody who can help me find out how to configure the hardware using vb 6.0 step by step.
User is offlineProfile CardPM
+Quote Post

thava
RE: Thumbprint Image Retrieval Using Visual Basic 6.0
14 Oct, 2008 - 06:47 AM
Post #2

D.I.C Regular
Group Icon

Joined: 17 Apr, 2007
Posts: 442



Thanked: 18 times
Dream Kudos: 50
My Contributions
hi is it any dll with that machine then use that dll

(ie) if any setup with that machine then run the setup find the dll in the des
deploying path or system folder and try to use that one

This post has been edited by thava: 14 Oct, 2008 - 06:49 AM
User is offlineProfile CardPM
+Quote Post

heavolk
RE: Thumbprint Image Retrieval Using Visual Basic 6.0
14 Oct, 2008 - 07:43 AM
Post #3

New D.I.C Head
*

Joined: 27 Aug, 2008
Posts: 3

this is my code..i have try to connect but the image not appear on my form..


CODE
Option Explicit

Dim WithEvents gettmpl As FPGetTemplate

Dim verifier As FPVerify

Dim tmpl As FPTemplate
Dim tmplrec As FPTemplate
Dim blob() As Byte
Dim res As AIErrors
    
Dim conn As ADODB.Connection
Dim rs1 As ADODB.Recordset

'Dim con As ADODB.Connection
'Dim recset As ADODB.Recordset

Dim Rx As Long
Dim AddNewStatus As Boolean
Dim xCount As Integer
Dim db_name, db_server, db_port, db_user, db_pass, constr As String

Dim WithEvents op As FPRegisterTemplate
Dim regtemplate As FPTemplate
Dim cursample As Integer

Private Sub clear_Click()

      txtInput.Text = ""
      txtUserID.Text = ""
      txtClassID.Text = ""
      txtFirstName.Text = ""
      txtLastName.Text = ""
      txtStatus.Text = ""
End Sub

Private Sub cmdDelete_Click()

conn.Execute "DELETE FROM user Where userID = '" & txtInput & "'"
    Rx = Rx - 1
    ShowData
    
     txtUserID.Text = ""
      txtClassID.Text = ""
      txtFirstName.Text = ""
      txtLastName.Text = ""
      txtStatus.Text = ""
  
    
End Sub

Private Sub cmdPrint_Click()
Unload Me
frmPrint.Show
End Sub

Private Sub cmdSearch_Click()

On Error Resume Next
    Dim rs As ADODB.Recordset
    Dim sql As String
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseServer
    sql = "select * from user where userID LIKE '" & txtInput.Text & "%'"
    rs.Open sql, conn, adOpenStatic, adLockReadOnly, adCmdText
    
    rs.Find "userID LIKE '" & txtInput.Text & "'"
    
    If rs.EOF = True Then
        rs.Close
        Set rs = Nothing
        
    End If
    If IsNull(rs!userID) Then
        
      txtUserID.Text = ""
      txtClassID.Text = ""
      txtFirstName.Text = ""
      txtLastName.Text = ""
      txtStatus.Text = ""
      
    Else
        txtUserID.Text = rs!userID
        txtClassID.Text = rs!classID
        txtFirstName = rs!firstName
        txtLastName.Text = rs!lastName
        txtStatus.Text = rs!statususer
        
    End If
    
    
    'On Error GoTo error
   ' con.Open
   ' recset.Open "SELECT * FROM user", con, adOpenStatic, adLockOptimistic
    'recset.MoveFirst
    
    Set gettmpl = New FPGetTemplate
    gettmpl.TemplateType = Tt_Verification
    gettmpl.Run
    Exit Sub
'error:
   ' MsgBox Err.Description
    
    
    Dim i As Integer
    
    op.Run
    cursample = 0
    For i = 0 To 1
        imgthumb(i).Picture = Nothing
        Shape1(i).Visible = False
    Next i
  
    Shape1(cursample).Visible = True
   lblInfo.Caption = "place your thumb on the device"

    Exit Sub
    
error:
    MsgBox "The current username is invalid. Please change it."
    rs.Close
    Set rs = Nothing
        
End Sub
Private Sub gettmpl_Done(ByVal pTemplate As Object)
    Set tmpl = New FPTemplate
    Set tmpl = pTemplate
    verify
End Sub
Private Sub gettmpl_SampleReady(ByVal pSample As Object)

    pSample.PictureOrientation = Or_Portrait
    pSample.PictureWidth = thumb.Width / Screen.TwipsPerPixelX
    pSample.PictureHeight = thumb.Height / Screen.TwipsPerPixelX
    imagethumb.Picture = pSample.Picture
        
End Sub

Private Sub exit_Click()

If (MsgBox("Do you really want to exit?", vbOKCancel, "Exit") = vbOK) Then Unload Me

End Sub

Private Sub save_Click()

    If DupCheck(txtUserID.Text) = True Then
        MsgBox "Duplicate Record ", , "Warning"
    Else
        conn.Execute "INSERT INTO user(userID,classID,firstName,lastName,statususer) values('" & txtUserID & "','" & txtClassID & "','" & txtFirstName & "','" & txtLastName & "','" & txtStatus & "')"
    End If
  



End Sub



Private Sub savethumb()

    Dim bvariant As Variant
    Dim blob() As Byte

    Dim bilrc As Integer
    If regtemplate Is Nothing Then
        MsgBox "No Registrator Template"
        Exit Sub
  
    End If
    
    If regtemplate.Export(bvariant) <> Er_OK Then
        Exit Sub
    End If
    
    Dim con As ADODB.Connection
    Dim recset As ADODB.Recordset
        
    Set con = New ADODB.Connection
    Set recset = New ADODB.Recordset
    con.ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=attendance;UID=root;PWD=;OPTION=16427"
    con.CursorLocation = adUseClient
    On Error GoTo error
    con.Open
    recset.Open "SELECT * FROM user WHERE userID='" & txtInput.Text & "'", con, adOpenStatic, adLockOptimistic
    recset!Template = bvariant
    recset!templateid = regtemplate.InstanceID
    lblInfo.Caption = "database has been successfully updated"
    recset.Update
    Exit Sub

error:
    MsgBox Err.Description, vbCritical, "Error"

End Sub


Private Sub Form_Load()

If txtInput.Text = "" Then
        MsgBox "Please input user id"
        Exit Sub
    End If
    
    Dim con1 As ADODB.Connection
    Dim recset1 As ADODB.Recordset
        
    Set con1 = New ADODB.Connection
    Set recset1 = New ADODB.Recordset
    
    con1.ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=attendance;UID=root;PWD=;OPTION=16427"
    con1.CursorLocation = adUseClient
    On Error GoTo error
    con1.Open
    recset1.Open "SELECT * FROM user WHERE userID='" & txtInput.Text & "'", con1, adOpenStatic, adLockOptimistic
    txtUserID = recset1!userID
    txtClassID = recset1!classID
    txtFirstName = recset1!firstName
    txtLastName = recset1!lastName
    txtStatus = recset1!statususer
    
    Dim i As Integer
    op.Run
    cursample = 0
    For i = 0 To 3
        Picture1(i).Picture = Nothing
        Shape1(i).Visible = False
    Next i
  
    Shape1(cursample).Visible = True
    lblInfo.Caption = "place your thumb on the device"

    Exit Sub
    
error:
    MsgBox "The current username is invalid. Please change it."

End Sub
'Dim i As Integer


   ' On Error GoTo DBerror
   ' db_name = "attendance"
   ' db_server = "localhost"
   ' db_port = ""    'default port is 3306
   ' db_user = "root"
  '  db_pass = ""
  
  '  ConnServer ' Open with ODBC in Control Panel
  
  '  Rx = 0
  '  ShowData
    
  
  '  Exit Sub
'DBerror:
  
    ' ShowData
    

   ' For i = 0 To 1
     '   imgthumb(i).Picture = Nothing
  
   ' Next i

   ' cursample = 0
   ' Set op = New FPRegisterTemplate
    
   ' lblInfo.Caption = "Enter user ID. Note: users must be registered first by the admin"


'End Sub
Private Sub ConnServer()
  'connect to MySQL server using MySQL ODBC 3.51 Driver
  Set conn = New ADODB.Connection
  conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
                        & "SERVER=localhost;" _
                        & " DATABASE=attendance;" _
                        & "UID=root;PWD=; OPTION=3"
conn.Open
End Sub

Private Sub op_Done(ByVal pTemplate As Object)
    Set regtemplate = pTemplate
    savethumb
End Sub

'Private Sub op_Error(ByVal errcode As DpSdkOpsLib.AIErrors)
  '  MsgBox errorcode
'End Sub

Private Sub op_SampleQuality(ByVal Quality As DpSdkEngLib.AISampleQuality)

    'MsgBox Quality
    Select Case Quality
        Case Sq_Good
        cursample = cursample + 1
    
        If cursample <> 2 Then
            Shape1(cursample).Visible = True
        End If
    
    End Select

End Sub

Private Sub op_SampleReady(ByVal pSample As Object)

    pSample.PictureOrientation = Or_Portrait
    pSample.PictureWidth = imgthumb(cursample).Width / Screen.TwipsPerPixelX
    pSample.PictureHeight = imgthumb(cursample).Height / Screen.TwipsPerPixelX
    imgthumb(cursample).Picture = pSample.Picture

End Sub
Private Sub SaveData()
    Dim rs As ADODB.Recordset
    Dim sql As String
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseServer
            If AddNewStatus = True Then
                rs.Open "select * from user", conn, adOpenStatic, adLockOptimistic, adCmdText
            
                AddNewStatus = False
                rs.AddNew
                  
          Else
              sql = "select * from user where userID = '" & txtUserID.Text & "'"
              rs.Open sql, conn, adOpenStatic, adLockOptimistic, adCmdText
           End If

    
    rs!userID = txtUserID.Text
    rs!classID = txtClassID.Text
    rs!firstName = txtFirstName.Text
    rs!lastName = txtLastName.Text
    rs!statususer = txtStatus.Text
    
    rs.Update
    rs.Close
    Set rs = Nothing
    save.Enabled = False
    
End Sub
Private Sub DelData()
    Dim rsTemp As ADODB.Recordset
    Dim sql As String
    Set rsTemp = New ADODB.Recordset
    rsTemp.CursorType = adOpenDynamic
    rsTemp.LockType = adLockOptimistic
    rsTemp.CursorLocation = adUseServer
    sql = "DELETE FROM user Where userID='" & txtInput.Text & "'"

    If MsgBox("Are you sure that you want to Delete this record?", vbYesNo + vbDefaultButton2 + vbCritical, "Confirm Delete") = vbNo Then
        Set rsTemp = Nothing
        Exit Sub
    End If
    rsTemp.Open sql, conn, adOpenKeyset, adLockOptimistic
    Set rsTemp = Nothing
End Sub

Private Sub ShowData()

    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenStatic
    rs.LockType = adLockReadOnly
    rs.Open "SELECT * FROM user", conn
        If rs.EOF = True Then
            rs.Close
            Set rs = Nothing
            Exit Sub
        End If
    xCount = rs.RecordCount
        If Rx > rs.RecordCount - 1 Then
            Rx = 0
        End If
        If Rx < 0 Then
            Rx = rs.RecordCount - 1
        End If
    rs.Move Rx
  
    txtUserID.Text = rs!userID
    txtClassID.Text = rs!classID
    txtFirstName.Text = rs!firstName
    txtLastName.Text = rs!lastName
    txtStatus.Text = rs!statususer
    rs.Close
    Set rs = Nothing
End Sub

Private Function DupCheck(chkID As String) As Boolean

    Dim rs As ADODB.Recordset
    Dim sql As String
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseServer
    sql = "select * from user where userID = '" & chkID & "'"
    rs.Open sql, conn, adOpenStatic, adLockOptimistic, adCmdText
    If rs.EOF = True Then
        rs.Close
        Set rs = Nothing
        Exit Function
    End If
    If chkID = rs!userID Then
        DupCheck = True
    Else
        DupCheck = False
    End If
    rs.Close
    Set rs = Nothing
End Function


User is offlineProfile CardPM
+Quote Post

thava
RE: Thumbprint Image Retrieval Using Visual Basic 6.0
14 Oct, 2008 - 06:22 PM
Post #4

D.I.C Regular
Group Icon

Joined: 17 Apr, 2007
Posts: 442



Thanked: 18 times
Dream Kudos: 50
My Contributions
you must verfy something
did you connect the correct dll if correct first check the available methods in that dll for that you can use the object browser this will give a crispy note on every function,

because i don't see any image viewer or ole or any ocx to view the thumb impression and moreover thumb machines have the capacity to store the thumb impressions inside the machine so check is that anything else or is it work only with computer(i.e) with onlie and offline you should ask this from your machine vendor

for every user you need to store more than two impression some times it may take check withthat also


these all are my openion only send the dll to my email i try to solve your problem

This post has been edited by thava: 14 Oct, 2008 - 06:24 PM
User is offlineProfile CardPM
+Quote Post

heavolk
RE: Thumbprint Image Retrieval Using Visual Basic 6.0
18 Oct, 2008 - 08:50 AM
Post #5

New D.I.C Head
*

Joined: 27 Aug, 2008
Posts: 3

i used grfinger 4.2...

in vb6 at project =>components => grfingerX control library

i also copy and paste in system32 grfinger.dll



User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:54AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month