注釋:
參數(shù)R:http://www.hbhlny.cn/content/090424/14/19147_3251622.html b=alltrim(thisform.Text2.value)
c=alltrim(thisform.Text3.value) if empty(b) &&此條件成立則說明該文本框是空的 messagebox("請輸入網(wǎng)站名稱",16,"系統(tǒng)提示") return else locate for 網(wǎng)站名稱=b if .not.eof() &&此條件成立,說明要添加的內(nèi)容和表中有重復(fù)的 go top messagebox("不允許有重復(fù)的網(wǎng)站名稱",16,"系統(tǒng)提示") return endif endif msg=messagebox('確定要添加記錄嗎?',32+4,'系統(tǒng)提示')
if msg=6 && 6為是、7否 &&以下將文本框內(nèi)的值插入記錄
INSERT INTO "contacts.types" ("subject_type_id","subject_type") ;
VALUES("alltrim(thisform.Text1.value)","alltrim(thisform.Text2.value)") messagebox('保存記錄成功!',64,'系統(tǒng)提示') thisform.grid1.refresh
calculate max(subject_type_id) to maxbh &&在數(shù)據(jù)表中查找出序號最大的記錄 szbh=val(right(maxbh,3)) &&取出數(shù)字部分 if szbh=0 then &&判斷數(shù)字部分是否為0 zdbh='KM001' else zdbh='wz'+padl(alltrim(str(szbh+1)),3,'0') &&生成自動編號 endif thisform.Text1.value=zdbh thisform.Text2.value="" thisform.Text2.setfocus thisform.refresh endif |
|