//-------------------------------
var
found,DoFirst,strindex,i,j,n,m,a:integer;
f:tsearchrec;
StrListCur1,StrListAll1,StrListCur2,StrListAll2,StrListCur3,StrListAll3,StrListCur4,StrListAll4:Tstringlist;
MyList,MyList1,MyList2,MyList3:TStringList;
Dir,filepath,filepath1,str,str1,str2,str3,str6,st,sfzh1,sfzh2,gmsfzhm1,gmsfzhm2,z_code,z_code1,sary_xh,sary_xh1,jssj,jssj1,htsj,xsj,dwsj,bh,cyh,bm,GMSFHM1,GMSFHM2,CZFWBH2,ssfj2,sspcs2,sssq2,dxtel,dxfsf,ccfwdz2,bjpcs,xcbk_xh,CRIMINAL_ID,bjxx_xh,bjbh,bjxh1,cyjlbh,cyjlxh1,cyjlxh,zzdz:string;
ss2:TSearchRec;
strs,strs1:tstrings;
begin
begin
i:=0;
mylist:=TStringlist.Create;
mylist.LoadFromFile(ExtractFilePath(Application.ExeName)+'js\ceshi.txt');
j:=mylist.Count;
while i<j do
begin
str:=mylist.Strings[i];
strs:=tstringlist.Create;
strs.Delimiter:='|';
strs.DelimitedText:=str;
begin
JYBH:=strs[0];
CSRXZ:=strs[1];
CSDWDZ:=strs[2];
JGDW:=strs[3];
SGRBH:=strs[4];
// RKSJ:=strs[5];
end;
//以上能不能通過讀取組態檔中的欄位名來操作
//例如(JYBH,CSRXZ,CSDWDZ,JGDW,SGRBH)欄位動態配置
//其中欄位可以隨時新增或洗掉
Inc(i);
with adoquery11 do
begin
close;
sql.Clear;
sql.Add('select count(*) as maxts from TZHY_JYJLZB where JYBH='''+JYBH+'''');
open;
end;
if adoquery11.FieldByName('maxts').AsInteger>0 then
begin
with ADOQuery1 do
begin
close;
sql.Clear;
sql.Add('update TZHY_JYJLZB set JYBH='''+JYBH+''',CSRXZ='''+CSRXZ+''',CSDWDZ='''+CSDWDZ+''',JGDW='''+JGDW+''',');
sql.Add('SGRBH='''+SGRBH+''' where JYBH='''+JYBH+'''');
execsql;
end;
end
else
begin
with ADOQuery1 do
begin
close;
sql.Clear;
sql.Add('insert into TZHY_JYJLZB(JYBH,CSRXZ,CSDWDZ,');
sql.Add('JGDW,SGRBH) ');
sql.Add('values('''+JYBH+''','''+CSRXZ+''','''+CSDWDZ+''','''+JGDW+''',');
sql.Add('''+SGRBH+''')');
execsql;
end;
end;
end;
end;
Mylist1:=TStringList.create;
MyList1.Clear;
MyList1.SaveToFile(''+ExtractFilePath(Application.ExeName)+'js\ceshi.txt');
end;
//----------------------------
uj5u.com熱心網友回復:
沒有一個人回答啊uj5u.com熱心網友回復:
//以上能不能通過讀取組態檔中的欄位名來操作
//例如(JYBH,CSRXZ,CSDWDZ,JGDW,SGRBH)欄位動態配置
//其中欄位可以隨時新增或洗掉
------------------------------------------------
可以通過組態檔實作:
定義一個二維陣列或包含兩個欄位的結構體陣列(delphi2007以后的可以用泛型單元的TDictionary).
讀取檔案時填充內容即可.
你也可以把需求整理一下發上來,大家一塊兒幫著處理
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/143672.html
標籤:數據庫相關
上一篇:任意多邊形求其最大內接矩形
下一篇:splwow64
