如题。我的\NETWORK\ADMIN下的
listener.ora文件内容是
# listener.ora Network Configuration File: C:\app\Administrator\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = www-329e254de92)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)tnsnames.ora文件内容就:
# tnsnames.ora Network Configuration File: C:\app\Administrator\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.C5LIG =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = NMP)(SERVER = WWW-329E254DE92)(PIPE = ORAPIPE))
)
(CONNECT_DATA =
(SERVICE_NAME = C5LIG)
)
)ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = www-329e254de92)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
我用Navicat 8 Lite for Oracle是可以连接上的,但是我用程序连接就出现如上的错误。郁闷中。。并waiting
listener.ora文件内容是
# listener.ora Network Configuration File: C:\app\Administrator\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = www-329e254de92)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)tnsnames.ora文件内容就:
# tnsnames.ora Network Configuration File: C:\app\Administrator\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.C5LIG =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = NMP)(SERVER = WWW-329E254DE92)(PIPE = ORAPIPE))
)
(CONNECT_DATA =
(SERVICE_NAME = C5LIG)
)
)ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = www-329e254de92)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
我用Navicat 8 Lite for Oracle是可以连接上的,但是我用程序连接就出现如上的错误。郁闷中。。并waiting
Cause: The user attempted to pass an attribute that is too long
Action: Shorten the specified attribute and retry the operation.
{
conn_ = env_->createConnection(userid, password, dbname);
}userid="C5LIG"
passwd="C5LIG"
dbname="ORCL"
还怎么短法???????
In the 10.1 version of oracle there is a separate version of the oraocci10 library built with msvcrt.lib and my own application uses the same version of the crt implementation (msvcrt.lib). The 10.2 release of oracle has only versions of the oraocci10 library built with msvcrt7 or older implementations of crt.
The work-around is to build my application using the includes and the libs from release 10.1 and package the oraocci10.dll library from the 10.1 release in the same folder as the application so it gets loaded instead of the oraocci10.dll supplied as part of the client installed on the host. This oraocci10.dll will still use the OCI version supplied as part of the oracle client so no functionality will be lost from that perspective.
IMHO the fix is to get OCCI team to build a version of oraocci10 with visual studio 6. 不知道有没有帮助
1)在解决方案配置里面我选择的是“debug”;
2)我链接的是“oraocci10.lib”,而实际上要链接“oraocci10d.lib”;
3)没把“oraocci10d.dll”拷贝到编写的程序的Debug目录下;这种情况下就出现了楼主标题中的情况。希望对楼主有帮助。
相应的,
1)程序链接“oraocci10d.lib”;
2)把“oraocci10d.dll”拷贝到程序的Debug目录下;
就OK了。当然,需要先下载occi对应vs2005的开发包。