ADO.NET如何和ORACLE数据库连接?

wsansan 2002-03-12 07:41:16
ADO.NET如何和ORACLE数据库连接?
和Access连接可以如下,
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0" & _
";Data Source=" & Server.MapPath("Sample.mdb")
而和ORACLE连接呢?
...全文
26 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
karma 2002-03-12
OLE DB Provider for Oracle (from Microsoft)

oConn.Open "Provider=msdaora;" & _
"Data Source=MyOracleDB;" & _
"User Id=myUsername;" & _
"Password=myPassword;"


OLE DB Provider for Oracle (from Oracle)

For Standard Security:

oConn.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
For a Trusted Connection:

oConn.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"User Id=/;" & _
"Password=;"
' Or
oConn.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"OSAuthent=1;"

Note: "Data Source=" must be set to the appropriate Net8 name which
is known to the naming method in use. For example, for Local Naming,
it is the alias in the tnsnames.ora file; for Oracle Names, it is the Net8 Service Name.


read more at:
http://www.able-consulting.com/ado_conn.htm?f=ado_conn.htm#OLEDBProviderForOracleFromMicrosoft
  • 打赏
  • 举报
回复
发帖
.NET技术其他语言

1853

社区成员

.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
帖子事件
创建了帖子
2002-03-12 07:41
社区公告
暂无公告