如题
解决方案 »
- help 没有安装Delphi,请帮忙试一下下面的代码
- 关于Devexpress dxpagecontrol 控件的使用
- Excel文件导入Access中遇到的重大问题:Excel文件中有一列为“检查时间”....在线等待....在线等待
- 有关打印
- SQL数据库超过4G就插不入了,也是PRIMARY 文件组分配空间的问题
- 如何根据字段的名称查到字段的类型?谢谢!
- 望高人指点迷津
- 求助,有关(dbgrideh)
- 寻找窗体分割控件
- MIDAS三层结构中如何在客户端读取服务器磁盘上给定路径的一个JPG文件。。急!!!
- 想做一个P2P软件,不知道用什么开发语言?
- 关于注册Active控件的出现的问题,请教一下各位
begin
ShowMessage(DataSet.Fields[0].AsString);
end;
TDataSet.GetCurrentRecord
This function always returns False, indicating failure. TDataSet descendants override this method to retrieve the value of the current record. If Buffer is successfully filled with the value of the current record, GetCurrentRecord should return True.
不行的话还是
fieldbyname('字段1'),fieldbyname('字段2')吧
table 中有三个字符型字段
a1 10位
a2 8位
a3 6位
}
type
TableRec=packed record
a1:array[0..9] of char;
a2:array[0..7] of char;
a3:array[0..5] of char;
end;procedure TForm1.Button1Click(Sender: TObject);
var rec:TableRec;
begin
table1.open;
if table1.GetCurrentRecord(@rec) then
begin
edit1.text:=rec.a1;
edit2.text:=rec.a2;
edit3.text:=rec.a3; end;end;
然后再getCurrentRecord(buffer);这样行吗?
table 中有三个字符型字段
a1 10位
a2 8位
a3 6位
}
type
pTableRec=^TableRec;
TableRec=packed record
a1:array[0..9] of char;
a2:array[0..7] of char;
a3:array[0..5] of char;
end;
procedure TForm1.Button2Click(Sender: TObject);
var p:pchar;
begin
table1.open;
p:=StrAlloc(table1.RecordSize);
if table1.GetCurrentRecord(p) then
begin
with pTableRec(p)^ do
begin
edit1.text:=a1;
edit2.text:=a2;
edit3.text:=a3;
end;
end;end;
是用adoquery进行连接的
我的数据表里有一个字段是rec_no是自动增长且设为主关键字的,跟字段类型应该没有关系吧
我的代码如下:
p:=StrAlloc(dm.q_rs_pd_yssj.RecordSize);
if dm.q_rs_pd_yssj.GetCurrentRecord(p) then
begin
with pTableRec(p)^ do
begin
showmessage(cbdbh);
end;
end
else
showmessage('jin');
我从来不用ado,不能帮你试了