Home > database >  How to realize the field and uniqueness in pb database
How to realize the field and uniqueness in pb database

Time:10-01

There is a bookinfo table, I in the pb database contains bookid fields, you need to implement the uniqueness of bookid field, now want to in the program, when the administrator to bookinfo add records in the table, if you have bookid as 001 books, cannot add bookid again for 001. Please help each master,

CodePudding user response:

And I've put the bookinfo bookid field in a primary key,

CodePudding user response:

Since you set bookid primary key, it must be added into, can add the following code to determine
If the sqlca. Code<> 0 then
Messagebox (" error ", "bookid already exists!" )
End the if

CodePudding user response:

Agree with upstairs,
  • Related