ITPub博客

首页 > Linux操作系统 > Linux操作系统 > delphi连数据库

delphi连数据库

原创 Linux操作系统 作者:aishu521 时间:2013-01-22 21:29:09 0 删除 编辑

插入数据 

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/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: AP server 對時監控
请登录后发表评论 登录
全部评论

注册时间:2012-05-26

  • 博文量
    139
  • 访问量
    721099