ado使用框架中的数据库配置连接数据库

  With dm Do
  Begin
    dm.ztapp.ztserver.getserverinfo('dsquery', server, user, dbname, password, diver);
  End;
  strtemp :=
    'Provider=SQLOLEDB.1;Password=123;Persist Security Info=True;User ID=sa;Initial Catalog=2014bzlabinfo;Data Source=server';
  strtemp := StringReplace(strtemp, 'sa', user, [rfreplaceall]);
  strtemp := StringReplace(strtemp, '123', password, [rfreplaceall]);
  strtemp := StringReplace(strtemp, '2014bzlabinfo', dbname, [rfreplaceall]);
  strtemp := StringReplace(strtemp, 'server', server, [rfreplaceall]);
  qry1.ConnectionString := strtemp;
  qry1.LockType := ltBatchOptimistic;
  qry1.CacheSize := 2048;
  qry1.CursorType := ctStatic;


你可能感兴趣的:(Delphi,delphi)