zoukankan      html  css  js  c++  java
  • 连接数据库2005的字符串

    SQL Native Client ODBC Driver

    标准安全连接
       
    Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

    您是否在使用SQL Server 2005 Express? 请在“Server”选项使用连接表达式“主机名称\SQLEXPRESS”。
      
    受信的连接
       
    Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;

    "Integrated Security=SSPI" 与 "Trusted_Connection=yes" 是相同的。
      
    连接到一个SQL Server实例
    指定服务器实例的表达式和其他SQL Server的连接字符串相同。  
    Driver={SQL Native Client};Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=yes;

       
    指定用户名和密码
    oConn.Properties("Prompt") = adPromptAlways

    Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;

       
    使用MARS (multiple active result sets)
       
    Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;MARS_Connection=yes;

    "MultipleActiveResultSets=true"与MARS_Connection=yes"是相同的。
    使用ADO.NET 2.0作为MARS的模块。 MARS不支持ADO.NET 1.0和ADO.NET 1.1。
      
    验证网络数据
       
    Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Encrypt=yes;

       
    使用附加本地数据库文件的方式连接到本地SQL Server Express实例
       
    Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;

    为何要使用Database参数?如果同名的数据库已经被附加,那么SQL Server将不会重新附加。
      
    使用附加本地数据文件夹中的数据库文件的方式连接到本地SQL Server Express实例
       
    Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;

    为何要使用Database参数?如果同名的数据库已经被附加,那么SQL Server将不会重新附加。
      
    数据库镜像
    Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True;


      
    SQL Native Client OLE DB Provider

    标准连接
       
    Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

    您是否在使用SQL Server 2005 Express? 请在“Server”选项使用连接表达式“主机名称\SQLEXPRESS”。
      
    受信的连接
       
    Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;

    "Integrated Security=SSPI"与"Trusted_Connection=yes"相同
      
    连接到SQL Server实例
    指定服务器实例的表达式和其他SQL Server的连接字符串相同。  
    Provider=SQLNCLI;Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=yes;

       
    使用帐号和密码
    oConn.Properties("Prompt") = adPromptAlways

    oConn.Open "Provider=SQLNCLI;Server=myServerAddress;DataBase=myDataBase;

       
    使用MARS (multiple active result sets)
       
    Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;MarsConn=yes;

    "MultipleActiveResultSets=true"和"MARS_Connection=yes"是相同的。
    使用ADO.NET 2.0作为MARS的模块。 MARS不支持ADO.NET 1.0和ADO.NET 1.1。
      
    验证网络数据
       
    Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Encrypt=yes;

       
    使用附加本地数据库文件的方式连接到本地SQL Server Express实例
       
    Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;

    为何要使用Database参数?如果同名的数据库已经被附加,那么SQL Server将不会重新附加。
      
    使用附加本地数据文件夹中的数据库文件的方式连接到本地SQL Server Express实例
       
    Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;

    为何要使用Database参数?如果同名的数据库已经被附加,那么SQL Server将不会重新附加。
      
    数据库镜像
    Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True;


      
    SqlConnection (.NET)

    标准连接
       
    Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

    使用serverName\instanceName作为数据源可以指定SQL Server实例。
    您是否在使用SQL Server 2005 Express? 请在“Server”选项使用连接表达式“主机名称\SQLEXPRESS”。
      
    Standard Security alternative syntax
    Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;

       
    受信任的连接
       
    Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

       
    Trusted Connection alternative syntax
    Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

       
    连接到一个SQL Server的实例
    指定服务器实例的表达式和其他SQL Server的连接字符串相同。  
    Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;

       
    来自WinCE设备的安全连接
    Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;

    仅能用于CE设备。
      
    带有IP地址的连接
       
    Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;


      
    使用MARS (multiple active result sets)
       
    Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;MultipleActiveResultSets=true;

    使用ADO.NET 2.0作为MARS的模块。 MARS不支持ADO.NET 1.0和ADO.NET 1.1。
      
    使用附加本地数据库文件的方式连接到本地SQL Server Express实例
       
    Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;

    为何要使用Database参数?如果同名的数据库已经被附加,那么SQL Server将不会重新附加。
      
    使用附加本地数据文件夹中的数据库文件的方式连接到本地SQL Server Express实例
       
    Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;

    为何要使用Database参数?如果同名的数据库已经被附加,那么SQL Server将不会重新附加。
      
    使用在SQL Server Express实例上的用户实例
    Data Source=.\SQLExpress;Integrated Security=true;AttachDbFilename=|DataDirectory|\mydb.mdf;User Instance=true;

    数据库镜像
    Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True;

    Asynchronous processing
    Server=myServerAddress;Database=myDataBase;Integrated Security=True;Asynchronous Processing=True;


    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/jyh_jack/archive/2008/04/07/2257512.aspx

  • 相关阅读:
    【转】React Native 关于箭头函数、普通函数与点击事件的调用
    【转】React Native Config.h not found ( glog-0.3.4 )
    微软必应Bing搜索引擎这几天无法访问!
    Beyond Compare 4 提示错误“这个授权密钥已被吊销”的解决办法
    flock
    Getting.Started.with.Unity.2018.3rd.Edition
    Joe Hocking
    Unity 2018 By Example 2nd Edition
    Unity 2017 Game Optimization 新版
    Why is it called “armature” instead of “skeleton”? or perhaps “rig”?
  • 原文地址:https://www.cnblogs.com/xinzhuangzi/p/4100683.html
Copyright © 2011-2022 走看看