最新下载
热门教程
- 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;" & _