Home > Back-end > Delphi7 how to add the serial number in the table
Delphi7 how to add the serial number in the table
Time:09-19
Using sql2000 query dbgrid I have a sales table, table orderly number (dj_sn) fields, while sales of make out an invoice number automatically increase and deposited in the database, now can increase, but if delete a line, the serial number is wrong, (if: I have 10 rows of data, I delete the first line, the line at the back of the serial number will be minus one in order to) will be the new serial number assigned to the dj_sn this column, now is too slow, still have what way?
CodePudding user response:
My experience, the original is not I on the table there is a number or serial number of the field, use the DBGrid, you are not the same problems, through practice: 1, cancel the number or sequence number field in the table, 2, use DBGridEh shows that as long as the property of ancient dghShowRecNo is True, can be the first column shows the number of rows in the table automatically, 3, print form, use RecNo serial number, can, very convenient,
CodePudding user response:
The key is I want to put the serial number to a database table, DBGridEh line?
CodePudding user response:
What are you doing to save it? Useful
CodePudding user response:
Useful, of course, a table, there are a lot of list, each list to difference with ticket number, serial number, are there in each of the documents so that the serial number in the table is a field, so DBGrid just show
CodePudding user response:
If there is a serial number "" in each of the documents, it should not be" I have 10 rows of data, I delete the first line, the line at the back of the serial number will, in turn, minus one " If you the serial number is to discharge in order according to the record, it's no use,
CodePudding user response:
Don't need a table number, because each list, can have its own serial number, Using RecNo print form, serial number, can, very convenient,
CodePudding user response:
Logic design problems
CodePudding user response:
Procedure Tfrm_zj. DBGridPane3Main1DBTableView1RowNoGetDisplayText ( Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; Var AText: String); The begin Inherited; AText:=IntToStr (ARecord. Index + 1); end;
CodePudding user response:
Upstairs is a way, there is a way, if use SQL2000 is determined, you can use the trigger, in the case of delete events, to perform the update SQL, such as serial number record number,
CodePudding user response:
Generally are discontinuous number allows documents, if it is one of the documents detailed need continuous, but in the audit process, recalculate the serial number