.net数据库连接字符

.net数据库连接字符

1、联接SQL Server
     A、ODBC 方式
            Standard Security方式:"Driver={SQL Server};Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;" 
            Trusted 方式:"Driver={SQL Server};Server=Aron1;Database=pubs;Trusted_Connection=yes;" 
            需要提示的:
            oConn.Properties("Prompt") = adPromptAlways
            oConn.Open "Driver={SQL Server};Server=Aron1;DataBase=pubs;" 

    B、OLE DB, OleDbConnection (.NET) 方式
            Trusted 方式:"Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;" 
            需要提示的:
            oConn.Provider = "sqloledb"
            oConn.Properties("Prompt") = adPromptAlways
            oConn.Open "Data Source=Aron1;Initial Catalog=pubs;" 
            联接网络数据库:
            "Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;" 

    C、SqlConnection (.NET)方式
            Standard Security方式:"Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;" 
                        或"Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False" 
            Trusted 方式:"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;" 
                        或"Server=Aron1;Database=pubs;Trusted_Connection=True;" 
            联接网络数据库:
                        "Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"

你可能感兴趣的:(sql,数据库,.net,server,server,Security,database)