最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
通过ADO连接各种数据库的字符串翠集(二)(完)
时间:2022-06-30 10:13:31 编辑:袖梨 来源:一聚教程网
(接上篇)
二 二、接下来讲使用OLE DB来连接数据库的例子。
1) OLE DB Provider for Active Directory Service
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=ADSDSOObject;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
oConn.Open strConn
%>
2) OLE DB Provider for DB2
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=DB2OLEDB;" &
"Network Transport Library=TCPIP;" &
"Network Address=MyServer;" & _
"Package Collection=MyPackage;" &
"Host CCSID=1142"
"Initial Catalog=MyDB;" &
"User ID=MyUsername;" & _
"Password=MyPassword;"
oConn.Open strConn
%>
3) OLE DB Provider for Index Server
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=msidxs;" & _
"Data source=MyCatalog;"
oConn.Open strConn
%>
4) OLE DB Provider for Internet Publishing
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=MSDAIPP.DSO;" & _
"Data Source=http://mywebsite/myDir;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
oConn.Open strConn
%>
5) OLE DB Provider for Microsoft Jet
● 标准的也是常用的访问方式。
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
二 二、接下来讲使用OLE DB来连接数据库的例子。
1) OLE DB Provider for Active Directory Service
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=ADSDSOObject;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
oConn.Open strConn
%>
2) OLE DB Provider for DB2
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=DB2OLEDB;" &
"Network Transport Library=TCPIP;" &
"Network Address=MyServer;" & _
"Package Collection=MyPackage;" &
"Host CCSID=1142"
"Initial Catalog=MyDB;" &
"User ID=MyUsername;" & _
"Password=MyPassword;"
oConn.Open strConn
%>
3) OLE DB Provider for Index Server
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=msidxs;" & _
"Data source=MyCatalog;"
oConn.Open strConn
%>
4) OLE DB Provider for Internet Publishing
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=MSDAIPP.DSO;" & _
"Data Source=http://mywebsite/myDir;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
oConn.Open strConn
%>
5) OLE DB Provider for Microsoft Jet
● 标准的也是常用的访问方式。
<%
Dim oConn,strConn
Set oConn=Server.CreateObject(“ADODB.Connection”)
StrConn= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22