delphi Á¬½ÓsqliteÊý¾Ý¿â£¬insert±¨´í
¿ÉÒÔÌí¼ÓÊý¾Ý£¬µ«ÊǵãÌí¼Óºó»á±¨.access violation at address 0049AB84 in module
Ô´Âë
procedure Tstudent.add_buttonClick(Sender: TObject);
var
sqlstr:string;
begin
if (id_edit.Text='') and (username_edit.Text='') then
begin
application.MessageBox('ÇëÊäÈëÍêÕûÊý¾ÝÐÅÏ¢','Ìí¼Ó³ö´í',0);
id_edit.SetFocus;
exit;
end;
with ASQLite3Query1 do
begin
close;
sql.clear;
sql.add('insert into student values(:id,:username,:telephone,:address,:state)');
ASQLite3Query1.Params.ParamByName('id').Value:=strtoint(id_edit.Text);
ASQLite3Query1.Params.ParamByName('username').Value:=username_edit.Text;
ASQLite3Query1.Params.ParamByName('telephone').Value:=strtoint(phone_edit.Text);
ASQLite3Query1.Params.ParamByName('address').Value:=address_edit.Text;
ASQLite3Query1.Params.ParamByName('state').Value:=state_edit.Text;
execSQL;
showmessage(ASQLite3Query1.SQL.Text);
end;
end;
ÊÇÕâ¶Î´úÂëµÄÎÊÌâÂð£¿ÄãÏȼӸö¶Ïµã¿´¿´£¬ºÃÏñ²»ÊÇÕâ¶Î´úÂëµÄÎÊÌ⣡Ӧ¸ÃÊÇÄĸöÄ£¿é³öÎÊÌâÁË£¡
Â¥Ö÷µÄÄǸöÒ²²»ÐÐ
{{----}
Ïà¹ØÎÊ´ð£º
ÎÒ°²×°µÄÊÇÆóÒµ°æ¡£¡£¡£
ÎÒÎÊÏ£¬ CTRL+×ó¼ü Äܲ鿴 windows.pas Âð£¿
¾ÍÊÇ ½Ó¿ÚÀïµÄwindows¡£
µ±È»¿ÉÒÔ,CTRL+×ó¼üµã»÷Interface²¿·ÖµÄWindows¾Í¿ÉÒÔÁË
ɶɶÆóÒµ°æ£¿È¥°²×°Ä¿Â¼¿´¿´libÎļþ¼ÐÏÂÓÐÃ»Ó ......
VC++ ÖУ¬ &±äÁ¿Ãû¡£ ÊÇʲôÒâ˼¡£ DelphiÖÐ ºÍËûÒ»ÑùµÄ·ûºÅ ÊÇÄĸö¡¢£¿
´ó¼Ò¶¼ÈÏΪ£¬CÓïÑÔÖ®ËùÒÔÇ¿´ó£¬ÒÔ¼°Æä×ÔÓÉÐÔ£¬ºÜ´ó²¿·ÖÌåÏÖÔÚÆäÁé»îµÄÖ¸ÕëÔËÓÃÉÏ¡£Òò´Ë£¬ËµÖ¸ÕëÊÇCÓïÑÔµÄÁé»ê£¬Ò»µã¶¼²»Îª¹ý¡£Í¬Ê±£¬ ......
ÎҵijÌÐòÖÐÓÐÒ»¶Î¸üÐÂijһÌõ¼Ç¼µÄÓï¾ä£º
var
id:=integer;
begin
id:=strtoint(edit1.text);//edit1.textµÄÖµÒѾȡµÃ;
...
...
...
adoQuery1.sql.add('update ¼Æ»®Çåµ¥±í set ¼Æ»®ÈÕ ......
¸÷λ¸ßÊָϿì°ï°ïæ¡£
ÏÖÔÚÓÐÒ»¸ödelphiдµÄdll£¬º¯ÊýÖÐÓÐPIntegerµÄ·µ»Ø²ÎÊý£¬ÔÚdelphiÖпÉÒÔÕý³£µ÷Ó㬵«ÊÇÎÒÔÚvbÀïдµÄʱºò¾Í²»ÖªµÀ¸ÃÔõôÀ´µ÷ÓÃÁË¡£
Çë¿´´úÂë
ÒÔÏÂÊÇdelphiÖеĺ¯Êý¶¨ÒåºÍµ÷ÓôúÂ룬ÄÜÕý³£ÔËÐ ......