Q
qtlove
Unregistered / Unconfirmed
GUEST, unregistred user!
我想利用recordset临时生成某些字段,再与dbgrid相连
以下代码,属于实验,但没有效果,不知道为什么??
procedure TForm2.Button1Click(Sender: TObject);
var
rs:Variant;
begin
rs:=CreateOleObject('ADODB.RECORDSET');
rs.fields.append('fld',$00000081,5,$00000004);
rs.cursortype:=$00000001;
rs.locktype:=$00000003;
rs.open;
while not rs.eof do
begin
rs.fields('fld'):='abcde';
rs.update;
rs.movefirst;
edit1.text:=rs.fields['fld'];
rs.movenext;
//rs.close;
end;
rs.close;
end;
end.
望高手帮忙!!
以下代码,属于实验,但没有效果,不知道为什么??
procedure TForm2.Button1Click(Sender: TObject);
var
rs:Variant;
begin
rs:=CreateOleObject('ADODB.RECORDSET');
rs.fields.append('fld',$00000081,5,$00000004);
rs.cursortype:=$00000001;
rs.locktype:=$00000003;
rs.open;
while not rs.eof do
begin
rs.fields('fld'):='abcde';
rs.update;
rs.movefirst;
edit1.text:=rs.fields['fld'];
rs.movenext;
//rs.close;
end;
rs.close;
end;
end.
望高手帮忙!!