SQLServer Procedure 資料指標的問題 |
缺席
|
JamesLiang
初階會員 發表:54 回覆:78 積分:31 註冊:2003-02-13 發送簡訊給我 |
|
chimera
初階會員 發表:62 回覆:78 積分:28 註冊:2003-03-22 發送簡訊給我 |
|
chimera
初階會員 發表:62 回覆:78 積分:28 註冊:2003-03-22 發送簡訊給我 |
像這樣: procedure TForm1.BitBtn1Click(Sender: TObject);
var
i,j:integer;
begin
table1.open;
table2.open;
stringgrid1.fixedcols:=0;
stringgrid1.fixedrows:=0;
stringgrid1.RowCount:=table1.FieldCount;
stringgrid1.ColCount:=table1.RecordCount; table1.first;
for j:= 0 to (stringgrid1.colCount-1) do
begin
for i:= 0 to (stringgrid1.rowcount-1) do
begin
if table1.fields[i].asstring <> '' then
stringgrid1.cells[j,i]:=table1.Fields[i].AsString
else
stringgrid1.cells[j,i]:='0';
end; table1.Next;
end; table2.first;
for i:= 0 to stringgrid1.rowcount - 1 do
begin
table2.append;
table2.Fields[0].asstring:=stringgrid1.cells[0,i];
table2.Post;
end; table2.first;
for i:= 0 to stringgrid1.rowCount - 1 do
begin
for j:= 1 to stringgrid1.colcount - 1 do
begin
table2.edit;
table2.fields[j].asstring:=stringgrid1.cells[j,i];
table2.post;
end;
table2.next;
end;
end; 發表人 - chimera 於 2003/04/30 15:25:35
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |