zoukankan      html  css  js  c++  java
  • DBExpress动态连接SQL-Server

    procedure TForm1.Button1Click(Sender: TObject);
    var
      theCNN : TSQLConnection;//定义连接,要引用 DB, SqlExpr
    begin
      theCNN := TSQLConnection.Create(self);
      theCNN.LoginPrompt := False;//关闭登入窗口
      theCNN.Params.Clear;
      theCNN.DriverName:='MSSQL';
      theCNN.GetDriverFunc:='getSQLDriverMSSQL';
      theCNN.LibraryName:='dbexpmss.dll';
      theCNN.VendorLib:='oledb';
      //--------下面设置连接叁数-----------
      theCNN.Params.Append('SchemaOverride=sa.dbo');
      theCNN.Params.Append('DriverName=MSSQL');
      theCNN.Params.Append('HostName=LocalHostMSSQL'); //这是我SQL_Server服务器名
      theCNN.Params.Append('DataBase=KinSunKTV'); //SQL_Server数据库名称
      theCNN.Params.Append('User_Name=sa');  //SQL_Server用户名
      theCNN.Params.Append('Password=kinsun');//SQL_Server密码
      theCNN.Params.Append('BlobSize=-1');
      theCNN.Params.Append('ErrorResourceFile= ');
      theCNN.Params.Append('LocaleCode=0000');
      theCNN.Params.Append('MSSQL TransIsolation=ReadCommited');
      theCNN.Params.Append('OS Authentication=False');
      theCNN.Open;
      ShowMessage('连接成功');
    end;

  • 相关阅读:
    JAVA集合类汇总
    springmvc执行流程详细介绍
    java文件上传和下载
    Java中的Filter过滤器
    JSTL介绍及使用
    JSP知识汇总
    JAVA集合类汇总
    服务治理框架dubbo中zookeeper的使用
    map进程数量和reduce进程数量
    Hadoop的序列化
  • 原文地址:https://www.cnblogs.com/jijm123/p/10586770.html
Copyright © 2011-2022 走看看