标题:asp怎么连接oracle数据库
只看楼主
gesongs
Rank: 3Rank: 3
等 级:论坛游侠
威 望:3
帖 子:129
专家分:100
注 册:2011-7-7
结帖率:52.78%
已结贴  问题点数:20 回复次数:3 
asp怎么连接oracle数据库
有人知道如何编写 asp 链接 oracle数据的 代码吗?网上找了一段 运行不对

Set OraSession=CreateObject( "OracleInProcServer.XOraSession ")
Set OraDatabase=OraSession.DbOpenDatabase( "DSN", "用户名/密码",0)
dsn=odbc dsn,user=username,pwd=password   
Set OraDynaset=ebOraDatabase.DbCreateDynaset(sSql,0)
不知这段代码如何使用
其中DSN 如何配置呢?
我的 oracle 数据库:
tnsnames.ora
# TNSNAMES.ORA Network Configuration File: E:\oracle\ora92\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LABEL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = MICROSOF-712C66)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = label)
    )
  )

INST1_HTTP =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = MICROSOF-712C66)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = SHARED)
      (SERVICE_NAME = MODOSE)
      (PRESENTATION = http://HRService)
    )
  )
listener.ora
# LISTENER.ORA Network Configuration File: E:\oracle\ora92\network\admin\listener.ora
# Generated by Oracle configuration tools.LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = MICROSOF-712C66)(PORT = 1521))
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = label)
      (ORACLE_HOME = E:\oracle\ora92)
      (SID_NAME = label)
    )
  )
搜索更多相关主题的帖子: oracle 如何 password Network network 
2011-11-09 15:12
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:14 
用ADODB的连接字符串也能连接Oracle的
2011-11-10 13:05
gesongs
Rank: 3Rank: 3
等 级:论坛游侠
威 望:3
帖 子:129
专家分:100
注 册:2011-7-7
得分:0 
具体怎么链接呢?
2011-11-10 17:42
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:0 
使用oracle的连接字符串连接
http://wenku.baidu.com/view/e86f341d59eef8c75fbfb308.html
oracle的常用连接字符串写法
然后ADODB连接方法是一样的
Dim con
Set con=Server.CreateObject("ADODB.Connection")
con.ConnectionString="Oracle的连接字符串"
con.Open
2011-11-11 12:56



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-354716-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.121666 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved