asfman
android developer
posts - 90,  comments - 213,  trackbacks - 0
ASP中连接数据库(ADODB对象):

一、OLEDB连接方法

1.OLE DB Provider for AS/400
connstr = "Provider=IBMDA400;" Data source=myAS400;User Id=myUsername;Password=myPassword;"

2.OLE DB Provider for Active Directory Service
connstr = "Provider=ADSDSOObject;User Id=myUsername;Password=myPassword;"

3.OLE DB Provider for DB2
connstr = "Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=MyServer;Package Collection=MyPackage;Host CCSID=1142Initial Catalog=MyDB;User ID=MyUsername;Password=MyPassword;"

4.OLE DB Provider for Index Server
connstr = "Provider=msidxs;Data source=MyCatalog;"

5.OLE DB Provider for Internet Publishing
connstr = "Provider=MSDAIPP.DSO;Data Source=url;User Id=myUsername;Password=myPassword;"

6.OLE DB Provider for Microsoft Jet(access-this way will be best)
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dbpath;User Id=admin;Password=;"

7.OLE DB Provider for Microsoft Jet(Excel)
connstr = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dbpath;Extended Properties=""Excel 8.0;HDR=Yes;"";"

["HDR=Yes" means that there is a header row in the cell range (or named range), so the provider will not include the first row of the selection into the recordset. If "HDR=No", then the provider will include the first row of the cell range (or named ranged) into the recordset]

9.OLE DB Provider for Microsoft Jet(textfile)
connstr = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dbpath;Extended Properties=""text;HDR=Yes;FMT=Delimited;"";"

10.OLE DB Provider for ODBC Databases(access)
connstr = "Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)};Dbq=dbpath;Uid=myUsername;Pwd=myPassword;"

11.OLE DB Provider for ODBC Databases(SQL)
connstr = "Provider=MSDASQL;Driver={SQL Server};Server=myServerName;Database=myDatabaseName;Uid=myUsername;"Pwd=myPassword;"

12.OLE DB Provider for Oracle (from Microsoft)
connstr = "Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;"

13.OLE DB Provider for Simple Provider
connstr = "Provider=MSDAOSP;Data Source=MSXML2.DSOControl.2.6;"

14.OLE DB Provider for SQL Server
"Provider=sqloledb;Data Source=myServerName;Initial Catalog=myDatabaseName;User Id=myUsername;Password=myPassword;"

[if connection with ip address]
connstr = "Provider=sqloledb;Data Source=xxx.xxx.xxx.xxx,1433;Network Library=DBMSSOCN;Initial Catalog=myDatabaseName;User ID=myUsername;Password=myPassword;"

[1433 为SQL数据库默认接口]
posted on 2007-08-05 18:12 汪杰 阅读(1257) 评论(2)  编辑 收藏 引用 所属分类: asp(javascrpt)

FeedBack:
# re: OLEDB连接方法
2007-08-05 23:21 | 汪杰
OLE DB Provider for Simple Provider
 
The Microsoft OLE DB Simple Provider (OSP) allows ADO to access any data for which a provider has
been written using the OLE DB Simple Provider Toolkit. Simple providers are intended to access data
sources that require only fundamental OLE DB support, such as in-memory arrays or XML documents.

OSP in MDAC 2.6 has been enhanced to support opening hierarchical ADO Recordsets over arbitrary
XML files. These XML files may contain the ADO XML persistence schema, but it is not required. This
has been implemented by connecting the OSP to the MSXML2.DLL, therefore MSXML2.DLL or newer is
required.



oConn.Open "Provider=MSDAOSP;" & _
          "Data Source=MSXML2.DSOControl.2.6;"

oRS.Open "http://WebServer/VirtualRoot/MyXMLFile.xml", oConn


For more information, see: Microsoft OLE DB Simple Provider   回复  更多评论
  
# re: OLEDB连接方法
2009-03-04 16:45 | dd
用于 OLEDB 的 .Net Framework 数据提供程序(System.Data.OleDb)不支持用于 ODBC 驱动程序的 Microsoft OLE DB 提供程序(MSDASQL)。请使用用于 ODBC 的 .Net Framework 数据提供程序(System.Data.Odbc)。
  回复  更多评论
  
只有注册用户登录后才能发表评论。

<2019年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(15)

随笔分类(1)

随笔档案(90)

文章分类(727)

文章档案(712)

相册

收藏夹

http://blog.csdn.net/prodigynonsense

友情链接

最新随笔

搜索

  •  

积分与排名

  • 积分 - 384824
  • 排名 - 6

最新随笔

最新评论

阅读排行榜

评论排行榜