首页 > Linux操作系统 > Linux操作系统 > delphi连数据库
插入数据
sql_str:='insert into clickdbxk..checkresult(ModStation,GoodId,userid,createdate,creatime,result,Spec,GoodName ,side,BOMSiteID, ProgramName,MatchineName,PlaceExplain) ';
sql_Str:=sql_Str+' values('''+station+''','''+lotnum+''','''+userid+''','''+createdate+''','''+creatime+''','''+sresult+''','''+Spec+''','''+GoodName+''' ,1,'''+BOMSiteID+''', '''+ProgramName+''','''+MatchineName+''','''+PlaceExplain+''') ' ;
// ADOQuery2.Connection:=frmmain.ADOConnection1
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Text:=sql_Str;
try
ADOQuery2.ExecSQL;
except
v_result:=false;
adoquery2.Free;
end;
//sql2000
{ADOConnection1.Close;
ADOConnection1.ConnectionString:='Provider=SQLOLEDB.1;Password=sa123;Persist Security Info=True;'
+' User ID=sa;Initial Catalog=ClickDBXK;Data Source=127.0.0.1'; //Data Source=THX-LAB902
ADOConnection1.LoginPrompt:=False;
ADOConnection1.Open; }
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15187685/viewspace-753084/ ,如需转载,请注明出处,否则将追究法律责任。