关键词不能为空

当前您在: 主页 > 英语 >

SQL server 和MySQL的 connectionstring大全

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-15 14:07
tags:

-

2021年2月15日发(作者:agitation)



SQL SERVER






Standard Security


Data Source


=


mySer verAddress;


Initial Catalog


=< /p>


myDataBase;


User


Id


=


myUsername;


Passw ord


=


myPassword;






Standard Security alternative syntax


This connection string produces the same result as the previous one. The reason to include it is to


point out that some connection string keywords have many equivalents.


Server


=


myServerAd dress;


Database


=


my DataBase;


User


ID


=


myUsername;


Password

=


myPassword;


Trusted_Connec tion


=


False;






Trusted Connection


Data Sour ce


=


myServerAddress;

Initial Catalog


=


myDataBase ;


Integrated


Security

< br>=


SSPI;






Trusted Connection alternative syntax


This connection string produce the same result as the previous one. The reason to include it is to


point out that some connection string keywords have many equivalents.


Server< /p>


=


myServerAddress;


D atabase


=


myDataBase;

Trusted_Connection


=


True;



Use serverNameinstanceName as Data Source to use a specific SQL Server instance. Please note


that the multiple SQL Server instances feature is available only from SQL Server version 2000 and


not in any previous versions.




Connecting to an SQL Server instance



The syntax of specifying the server instance in the value of the server key is the same for all


connection strings for SQL Server.


Server


=

< p>
myServerNametheInstanceName;


Datab ase


=


myDataBase;


Tr usted_Connection


=


T


rue;






Trusted Connection from a CE device


Often a Windows CE device is not authenticated and logged in to a domain. To use SSPI or trusted


connection / authentication from a CE device, use this connection string.


Data Source

=


myServerAddress;


Initial C atalog


=


myDataBase;


Integrated


Security


=


SSPI;


User ID


=


myDomainmyUsername;


Password


=


myPassword;



Note that this will only work on a CE device.


Read more about connecting to SQL Server from CE devices here





Connect via an IP address


Data Source


=


190.1 90.200.100,1433;


Network Library

< br>=


DBMSSOCN;


Initial


Catalog


=


myDataBase;

< p>
User ID


=


myUsername;


Password


=


myPassword;





Specifying packet size


Serve r


=


myServerAddress;


Database


=


myDataBase;


User


ID


=


myUse rname;


Password


=


my Password;


Trusted_Connection


=


False;


Packet Size


=


4096;



By default, the Microsoft .NET Framework Data Provider for SQL Server sets the network packet


size to 8192 bytes. This might however not be optimal, try to set this value to 4096 instead.


The default value of 8192 might cause errors as well (


check this out





Microsoft OLE DB Provider for SQL Serv


er


Type:


OLE DB Provider


Usage:



Provider=sqloledb


Manufacturer:


Microsoft


More info about this provider ?



Customize string


example values ?



Standard Security


Provider


=


sqloledb;


Data Sour ce


=


myServerAddress;

Initial Catalog


=


myDataBase ;


User


Id


=

< br>myUsername;


Password


=

< p>
myPassword;






Trusted connection


Provider


=

< br>sqloledb;


Data Source


=


myServerAddress;


Initial

< br>Catalog


=


myDataBase;


Integrated Security


=


SSPI;



Use serverNameinstanceName as Data Source to use a specific SQL Server instance. Please note


that the multiple SQL Server instances feature is available only from SQL Server version 2000 and


not in any previous versions.




Connecting to an SQL Server instance



The syntax of specifying the server instance in the value of the server key is the same for all


connection strings for SQL Server.


Provider


=


sqloledb;


Data Source


=


myServerNametheInstanceName;


Initial


Catalog


=


myDataBase;


Integrated Security


=


SSPI;






Prompt for username and password


This one is a bit tricky. First set the connection object's Provider property to


set the connection object's Prompt property to adPromptAlways. Then use the connection string to


connect to the database.



er =


ties(



Data Source


=


myServerAddress;


Initial Catalog


=


myDataBase;< /p>






Connect via an IP address


Pr ovider


=


sqloledb;


D ata Source


=


190.190.200.100,1 433;


Network


Library

=


DBMSSOCN;


Initial Catalog< /p>


=


myDataBase;


User < /p>


ID


=


myUsername;


Password


=


myPassword;< /p>



DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data


Source is the port to use. 1433 is the default port for SQL Server.


How to define which network protocol to use





Disable connection pooling


This one is usefull when receving errors



application role enabled connection. Application pooling (or OLE DB resource pooling) is on by


default. Disabling it can help on this error.


Pr ovider


=


sqloledb;


D ata Source


=


myServerAddress;< /p>


Initial Catalog


=


my DataBase;


User


ID


=


myUsername;


Password

=


myPassword;


OLE DB Services


=


-2;






.NET Framework Data Provider for OLE DB



Type:


.NET Framework Wrapper Class Library


Usage:



onnection


Manufacturer:


Microsoft


More info about this wrapper class library ?



Customize string


example values ?



Bridging to OLE DB Provider for SQL Server


This is just one connection string sample for the wrapping OleDbConnection class that calls the


underlying OLEDB provider. See respective OLE DB provider for more connection strings to use


with this class.


Provider


=


S QLOLEDB;


Data Source


=

< br>myServerAddress;


Initial Catalog

< p>
=


myDataBase;


User

< p>
Id


=


myUsername;

< br> Password


=


myPassword;






Microsoft SQL Server ODBC Driver



Type:


ODBC Driver


Usage:



Driver={SQL Server}


Manufacturer:


Microsoft


Customize string


example values ?



Standard Security


Driver


=


{SQL

< p>
Server};


Server


=


myServerAddress;


Database


=


myDataBase;


Uid


=< /p>


myUsername;


Pwd


=


myPass


word;






Trusted connection


Driver


=


{SQL

< p>
Server};


Server


=


myServerAddress;


Database


=


myDataBase;


Trusted_Connecti on


=


Yes;






Prompt for username and password


This one is a bit tricky. First you need to set the connection object's Prompt property to


adPromptAlways. Then use the connection string to connect to the database.



ties(



Driver


=


{SQL Serve r};


Server


=


myServe rAddress;


Database


=


myDataBase;






SQL Server Native Client 10.0 OLE DB Provider



Type:


OLE DB Provider


Usage:



Provider=SQLNCLI10


Manufacturer:


Microsoft


More info about this provider ?



Customize string


example values ?



Standard security


Note that the SQL Server Native Client OLE DB Provider does not support SQL Server 7.0.


Provider


=


SQLNCLI10;


Server


=


myServerAddress;


Dat abase


=


myDataBase;


Uid


=


myUsername;


< /p>


Pwd


=


myPassword;






Trusted connection


Provider< /p>


=


SQLNCLI10;


Server< /p>


=


myServerAddress;


D atabase


=


myDataBase;


Trusted_Connection


=


yes;



Equivalent key- value pair:




Connecting to an SQL Server instance



The syntax of specifying the server instance in the value of the server key is the same for all


connection strings for SQL Server.


Provider


=


SQLNCLI10;


Server


=


myServerNametheInstanceName;


Dat abase


=


myDataBase;



Trusted_Connection


=

yes;






Prompt for username and password


This one is a bit tricky. First you need to set the connection object's Prompt property to


adPromptAlways. Then use the connection string to connect to the database.



ties(




=


SQLNCLI10;

< p>
Server


=


myServerAddress ;


DataBase


=


myDataB ase;






Encrypt data sent over network


Provider


=


SQLNCLI10;


Server


=


myServerAddress;


Database


=


myDataBase;



Trusted_ Connection


=


yes;


En crypt


=


yes;






SQL Native Client 9.0 OLE DB provider



Type:


OLE DB Provider


Usage:



Provider=SQLNCLI


Manufacturer:


Microsoft


More info about this provider ?



Customize string


example values ?



Standard security


Note that the SQL Server Native Client OLE DB Provider does not support SQL Server 7.0.


Provider


=


SQLNCLI;


Server

< p>
=


myServerAddress;


Datab ase


=


myDataBase;


Ui d


=


myUsername;



Pwd


=


myPassword;

< p>





Trusted connection


Provider< /p>


=


SQLNCLI;


Server


=


myServerAddress;


Dat abase


=


myDataBase;



Trusted_Connection


=

yes;



Equivalent key-value pair:




Connecting to an SQL Server instance



The syntax of specifying the server instance in the value of the server key is the same for all


connection strings for SQL Server.


Provider


=


SQLNCLI;


Server


=

< p>
myServerNametheInstanceName;


Datab ase


=


myDataBase;


< /p>


Trusted_Connection


=


yes;






Prompt for username and password


This one is a bit tricky. First you need to set the connection object's Prompt property to


adPromptAlways. Then use the connection string to connect to the database.



ties(




=


SQLNCLI;


Server


=


myServerAddress;< /p>


DataBase


=


myDataBas e;






Encrypt data sent over network

< br>Provider


=


SQLNCLI;

< br>Server


=


myServerAddress;


Database


=


myDataBase ;



Trusted_Connection

< br>=


yes;


Encrypt


=< /p>


yes;






SQL Server Native Client 10.0 ODBC Driver



Type:


ODBC Driver


Usage:



Driver={SQL Server Native Client 10.0}


Manufacturer:


Microsoft


More info about this driver ?



Customize string


example values ?



Standard security


Driver


=


{SQL Server Native Client


10.0};


S erver


=


myServerAddress;


Database


=


myDataBase;


Uid


=


myUsername;

< p>
Pwd


=


myPasswo


rd;






Trusted Connection


Driver


=


{SQL Server Native Client


10.0};


S erver


=


myServerAddress;


Database


=


myDataBase;


Trusted_Connection


=


y es;



Equivalent key-value pair:




Connecting to an SQL Server instance



The syntax of specifying the server instance in the value of the server key is the same for all


connection strings for SQL Server.


Driver


=


{SQL Server Native Client 10.0};


Server


=


myServerNametheInstanceName;

< p>


Database


=


m yDataBase;


Trusted_Connection


=


yes;






Prompt for username and password


This one is a bit tricky. First you need to set the connection object's Prompt property to


adPromptAlways. Then use the connection string to connect to the database.



ties(



Driver


=


{SQL Server Native Client


10.0};


S erver


=


myServerAddress;


Database


=


myDataBase;






Encrypt data sent over network


Driver


=


{SQL Server Native Client


10.0};


S erver


=


myServerAddress;


Database


=


myDataBase;



Trusted_Connection


=


yes;


Encrypt


=

< p>
yes;






SQL Native Client


9.0 ODBC Driver



Type:


ODBC Driver


Usage:



Driver={SQL Native Client}


Manufacturer:


Microsoft


More info about this driver ?



Customize string


example values ?



Standard security


Driver


=


{SQL Native Client};


Server


=


myServerAddress;


Database


=


myDataBase;



Uid


=


myUsername;


Pwd


=


myPassword;






Trusted Connection


Driver


=


{SQL Native Client};


Server


=


myServerAddress;


Database


=


myDataBase;



Tru sted_Connection


=


yes;

< br>


Equivalent key-value pair:




Connecting to an SQL Server instance



The syntax of specifying the server instance in the value of the server key is the same for all


connection strings for SQL Server.


Driver


=


{SQL Native


Client};


Server


=


myServerNametheInstanceName;


Database


=


myDataBase;



Trusted_Connection


=


yes;






Prompt for username and password


This one is a bit tricky. First you need to set the connection object's Prompt property to


adPromptAlways. Then use the connection string to connect to the database.



ties(



Driver


=


{SQL Native Client};


Server


=


myServerAddress;


Database


=


myDataBase;






Encrypt data sent over network


Driver


=


{SQL Native Client};


Server


=


myServerAddress;


Database


=


myDataBase;



Tru sted_Connection


=


yes;

< br>Encrypt


=


yes;






.NET Framework Data Provider for ODBC



Type:


.NET Framework Wrapper Class Library


Usage:



nnection


Manufacturer:


Microsoft


More info about this wrapper class library ?



Customize string


example values ?



Bridging to SQL Native Client 10.0 ODBC Driver


This is just one connection string sample for the wrapping OdbcConnection class that calls the


underlying ODBC Driver. See respective ODBC driver for more connection strings to use with this


class.


Driver


=


{SQL Server Native Client


10.0};


S erver


=


myServerAddress;


Database


=


myDataBase;


Uid


=


myUsername;

< p>
Pwd


=


myPasswo


rd;






SQLXML 3.0 OLEDB Provider



Type:


OLE DB Provider


Usage:



Provider=SQLXMLOLEDB.3.0;Data Provider=sqloledb


Manufacturer:


Microsoft


More info about this provider ?



Customize string


example values ?



Using SQL Server Ole Db


The SQLXML version 3.0 restricts the data provider to SQLOLEDB only.


Provider


=


SQLXMLOLEDB.3.0;


Data Provider


=


SQLOLEDB;


Data

< p>
Source


=


myServerAddress ;


Initial Catalog


=


myDataBase;


User


Id


=


myUsername;


Password


=


myPassword;






MSDataShape


Type:


Data Shaping COM component


Usage:



Provider=MSDataShape;Data Provider=providername


Manufacturer:


Microsoft


More info about this wrapper COM component ?


-


-


-


-


-


-


-


-



本文更新与2021-02-15 14:07,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/655389.html

SQL server 和MySQL的 connectionstring大全的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文