Z
zx
Unregistered / Unconfirmed
GUEST, unregistred user!
填入Sybase数据库的数据怎么会出错呢?
procedure TForm1.Button1Click(Sender: TObject);
var
beginip,endip: LongWord ;
beginipstr,endipstr: string;
begin
BeginIp:=LongWord(Edit9.Text);
endip :=LongWord(Edit10.Text);
beginipstr:=Edit1.Text+'.'+Edit2.Text+'.'+Edit3.Text+'.'+Edit4.Text;
endipstr:= Edit5.Text+'.'+Edit6.Text+'.'+Edit7.Text+'.'+Edit8.Text;
Table1.Append;
Table1['description']:= 'gsdfgsdfgsdfgdfjfhjf';
Table1['begin_ip']:= beginip; //库中的begin_ip,end_ip为一个real型数据
Table1['end_ip']:= endip;
Table1['begin_ipstring']:= beginipstr;
Table1['end_ipstring']:= endipstr;
Table1.Post;
end;
比如我填一个10位整数,到库里却成了9672016之类的数了,
而且当数大了,他总是96...多少的让我莫名其妙!
是不是有个什么类型转换的问题?
数据库是Sybase,而且我最大的数就是LongWord的4294967295
?/??
怎么办呢?
procedure TForm1.Button1Click(Sender: TObject);
var
beginip,endip: LongWord ;
beginipstr,endipstr: string;
begin
BeginIp:=LongWord(Edit9.Text);
endip :=LongWord(Edit10.Text);
beginipstr:=Edit1.Text+'.'+Edit2.Text+'.'+Edit3.Text+'.'+Edit4.Text;
endipstr:= Edit5.Text+'.'+Edit6.Text+'.'+Edit7.Text+'.'+Edit8.Text;
Table1.Append;
Table1['description']:= 'gsdfgsdfgsdfgdfjfhjf';
Table1['begin_ip']:= beginip; //库中的begin_ip,end_ip为一个real型数据
Table1['end_ip']:= endip;
Table1['begin_ipstring']:= beginipstr;
Table1['end_ipstring']:= endipstr;
Table1.Post;
end;
比如我填一个10位整数,到库里却成了9672016之类的数了,
而且当数大了,他总是96...多少的让我莫名其妙!
是不是有个什么类型转换的问题?
数据库是Sybase,而且我最大的数就是LongWord的4294967295
?/??
怎么办呢?