|
-
Apr 22nd, 2006, 02:35 PM
#1
Thread Starter
Fanatic Member
avoid duplication in SQL table
hi
i have a form in which there is a filelistbox.
when the user clicks on the command Display,the filelistbox displays filenames present in a specific directory entered by the user
spath=Trim(txtpath)
File1.path=spath
if the filelistbox contains 10 filenames,when the user clicks on OK,
it will create 10 records in a table Article
Private Sub cmdOK_Click()
Rs1.Open"Select*from Article",SIC,adOpenStatic,adLockOptimistic
For i=0 to File1.listCount-1
Rs1.AddNew
Rs1!Source=Trim(txtsource)
Rs1!CompleteFile=File1.List(i)
Rs1!Flag=0(Flag is of int type)
Rs1.Update
Rs1.close
My problem is that if after adding the records corresponding to the list of filenames if the user enters by mistake the same path another time and clicks on Ok
,so in the Article table there will be duplication.how to avoid that if the user enters the same path twice or more to not add records to the Article table
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|