0
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click

    ' Check if username or password is empty
    If txtPassword.Text = "" Or txtUsername.Text = "" Then
        MessageBox.Show("Please complete the required fields..", "Authentication Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    Else
        ' Both fields was supply
        ' Check if user exist in database
        ' Connect to DB
        Dim conn As New System.Data.OleDb.OleDbConnection()
        conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source = C:\Users\AMD\Desktop\sem 8 2013\fyp\vb\test last\test\fingerprint.accdb"



        Try
            'conn.Open()
            'MsgBox("Susscess")

            Dim sql As String = "SELECT * FROM admintable WHERE username='" & txtUsername.Text & "' AND password = '" & txtPassword.Text & "'"
            Dim sqlCom As New System.Data.OleDb.OleDbCommand(sql)

            'Open Database Connection
            sqlCom.Connection = conn
            conn.Open()

            Dim sqlRead As System.Data.OleDb.OleDbDataReader = sqlCom.ExecuteReader()

            If sqlRead.Read() Then

                '<retrieve fingerprint attachment from accdb>

            Else
                ' If user enter wrong username and password combination
                ' Throw an error message
                MessageBox.Show("Username and Password do not match..", "Authentication Failure", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)

                'Clear all fields
                txtPassword.Text = ""
                txtUsername.Text = ""

                'Focus on Username field
                txtUsername.Focus()
            End If

        Catch ex As Exception
            MessageBox.Show("Failed to connect to Database..", "Database Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try

    End If
End Sub

this is the coding that i developing. in application that i wanted, after the user successively enter the correct username and password, fingerprint template that store in accdb can be retrieve so it can be verify.

Can someone help me, my knowledge on visual basic and sql connection are limited.

And im using digital persona device to gain a fingerprint template and i using one touch SDK for the verification.

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
  • I do not think you can do it without DAO see http://stackoverflow.com/questions/11819247/reading-attached-files-from-database-using-ole-db/11819599#11819599 – Fionnuala Apr 10 '14 at 12:44

2 Answers2

0

Use the FileStream Method to read/store in the database in byte() then get the file extension to properly stored it back in what extension it is...

GoroundoVipa
  • 249
  • 3
  • 11
0

Using a FileStream you should be able to read and write any file you desire. Here is a good example to get you started.

http://www.codeproject.com/Articles/32216/How-to-store-and-fetch-binary-data-into-a-file-str

AhDev
  • 486
  • 11
  • 16