I want to make sure if the input ID has been in the databas. I use SQL to find a record which ID is same as inputID. But it takes time. Is there any faster way to check the input ID?
Printable View
I want to make sure if the input ID has been in the databas. I use SQL to find a record which ID is same as inputID. But it takes time. Is there any faster way to check the input ID?
To make your query as fast as possible, make sure the ID field is indexed in the db.
What program was the database created in?
If it was created in Access there is a feature where you can specify that duplicates are not allowed for a field. Then, in the sub where you were using SQL just put an error handler that displays a message box 'Duplicates are not allowed' or some such and exit the sub.
Hope that helps.
Eva