ADO Programming

Moderators: None (Apply to moderate this forum)
Number of threads: 87
Number of posts: 225

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
check duplicate record Posted by ganesh4u on 10 Aug 2005 at 4:42 AM
hi,
I am developing a database program.i am using adodb.Suppose user entered records in table with one primary keyfield.Next time when user add new record by Clicking add button recordset.addnew procedure will be executed which appends blank record .user will enter keyfield in textbox and press enter.when he press enter in code some procedure should execute which find whether this keyfield is already there or not.If by mistake user is making duplicate entry, message should pop up as "Record already exists" and cancel addnew procedure and show contents of that record.if it's not duplicate entry then it should follow normal procedure.
I have little idea how to do it but please guide me in details .please help me urgently.
Ganesh :)
Report
Re: check duplicate record Posted by PrzemekG_ on 14 Aug 2005 at 12:31 PM
: hi,
: I am developing a database program.i am using adodb.Suppose user entered records in table with one primary keyfield.Next time when user add new record by Clicking add button recordset.addnew procedure will be executed which appends blank record .user will enter keyfield in textbox and press enter.when he press enter in code some procedure should execute which find whether this keyfield is already there or not.If by mistake user is making duplicate entry, message should pop up as "Record already exists" and cancel addnew procedure and show contents of that record.if it's not duplicate entry then it should follow normal procedure.
: I have little idea how to do it but please guide me in details .please help me urgently.
: Ganesh :)
:
When you try to add a new record with duplicated primary key or a unique field, an error will be raised, so you will know the record already exists
Report
Re: check duplicate record Posted by GideonOmega on 17 Feb 2006 at 6:21 AM
: : hi,
: : I am developing a database program.i am using adodb.Suppose user entered records in table with one primary keyfield.Next time when user add new record by Clicking add button recordset.addnew procedure will be executed which appends blank record .user will enter keyfield in textbox and press enter.when he press enter in code some procedure should execute which find whether this keyfield is already there or not.If by mistake user is making duplicate entry, message should pop up as "Record already exists" and cancel addnew procedure and show contents of that record.if it's not duplicate entry then it should follow normal procedure.
: : I have little idea how to do it but please guide me in details .please help me urgently.
: : Ganesh :)
: :
: When you try to add a new record with duplicated primary key or a unique field, an error will be raised, so you will know the record already exists
:

if you want to check against Non - primary key data - before you add the data into the table open a recordset and search in the field for that value you want to check - then you can branch your logic to add the data - or display a message to the user.

C:\Dos
C:\Dos Run
Run Dos Run


Report
Re: check duplicate record Posted by Termc1224 on 17 May 2006 at 6:39 PM
: : : hi,
: : : I am developing a database program.i am using adodb.Suppose user entered records in table with one primary keyfield.Next time when user add new record by Clicking add button recordset.addnew procedure will be executed which appends blank record .user will enter keyfield in textbox and press enter.when he press enter in code some procedure should execute which find whether this keyfield is already there or not.If by mistake user is making duplicate entry, message should pop up as "Record already exists" and cancel addnew procedure and show contents of that record.if it's not duplicate entry then it should follow normal procedure.
: : : I have little idea how to do it but please guide me in details .please help me urgently.
: : : Ganesh :)
: : :
: : When you try to add a new record with duplicated primary key or a unique field, an error will be raised, so you will know the record already exists
: :
:
: if you want to check against Non - primary key data - before you add the data into the table open a recordset and search in the field for that value you want to check - then you can branch your logic to add the data - or display a message to the user.
:
: C:\Dos
: C:\Dos Run
: Run Dos Run
:

:
: On your Save button event
on error goto errmessage
rs.update
exit sub
errmessage:
if err.number = -2147217873 then
msgbox("Id already exist.")
else
msgbox(err.number & ": " & err.description)
end if






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.