borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Import data from Excel to Access Database through VB Code)Next Topic (Working on a Cyber Timer) New Topic New Poll Post Reply
AndreaVB Forum : Database : Redundant Data Verification!!! (Urgent)
Poster Message
Gary
Level: Sage

Registered: 27-11-2005
Posts: 50

icon Redundant Data Verification!!! (Urgent)

Hi,

If I wish to validate whether the user input is a duplicate data in database, how can I code it? Is there any sample code that are available?

I'm using ADO to perform add, delete, update and etc...

Thank you...


Gary

19-09-2006 at 08:44 AM
View Profile Send Email to User Show All Posts | Quote Reply
shahidmojid
Level: Professor

Registered: 09-05-2002
Posts: 85
icon Re: Redundant Data Verification!!! (Urgent)

You can add code under object lost focus events. If users input is duplicate then through an exception.

like

    Private Sub TextBox2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.LostFocus

   if bduplicate("write an sql query here") then
      msgbox "duplicate data please try again."
      textbox2.Focus
    End Sub

function bDuplicate(sql as string) as boolean
'below is not command just for your idea.
'open connection
'check for duplicate data by using passed parameter (sql)
'if duplicate data then 'bDuplicate = true else 'bduplicate = false
end function


shahid

21-09-2006 at 06:58 AM
View Profile Send Email to User Show All Posts | Quote Reply
Gary
Level: Sage

Registered: 27-11-2005
Posts: 50
icon Re: Redundant Data Verification!!! (Urgent)

Thanks sir,

I have better idea on it but may I know what SQL query I should write inside the bduplicate("SQL statement") because Im quite new in using SQL.

Anyway, thank you for your time...


Gary

27-09-2006 at 02:45 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Redundant Data Verification!!! (Urgent)
Previous Topic (Import data from Excel to Access Database through VB Code)Next Topic (Working on a Cyber Timer) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder