SQL SERVER分为两种登录方式:WINDOWS身份验证登录及混合身份验证登录
以下是两种OLEDE方式的连接串:
混合身份验证登录
SQLca.dbms= ‘OLEDB’ //接口类型
SQLca.AutoCommit = false
SQLca.LogPass = logpass
SQLca.LogId =logid
SQLca.DBParm ="PROVIDER='SQLOLEDB', DATASOURCE='"+serverName+"'," &
+"PROVIDERSTRING='Initial Catalog='"+database+"''"
WINDOWS身份验证登录
SQLca.dbms=‘OLEDB’ ’//接口类型
SQLca.AutoCommit = false
SQLca.DBParm ="PROVIDER='SQLOLEDB', DATASOURCE='"+serverName+"'," &
+"INTEGRATEDSECURITY='SSPI', " &
+"PROVIDERSTRING='Initial Catalog='"+database+"'' "