如题。我的\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

解决方案 »

  1.   

    ORA-24960: the attribute string is greater than the maximum allowable length of number 
    Cause: The user attempted to pass an attribute that is too long
     
    Action: Shorten the specified attribute and retry the operation.
     
      

  2.   

    if ( (conn_ == 0) && (env_ != NULL))
    {
        conn_ = env_->createConnection(userid, password, dbname);
    }userid="C5LIG"
    passwd="C5LIG"
    dbname="ORCL"
    还怎么短法???????
      

  3.   

    帮你google了一下The problem here is created by the strings passed as parameters in the call to createConnection method. They are not objects of the same class as expected by the oraocci10 library. 
    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. 不知道有没有帮助
      

  4.   

    楼主的问题不太清楚,我用VC2005+occi读写数据库的时候,也遇到了这个问题,描述一下我的情况,不知道对楼主有没有帮助:
    1)在解决方案配置里面我选择的是“debug”;
    2)我链接的是“oraocci10.lib”,而实际上要链接“oraocci10d.lib”;
    3)没把“oraocci10d.dll”拷贝到编写的程序的Debug目录下;这种情况下就出现了楼主标题中的情况。希望对楼主有帮助。
    相应的,
    1)程序链接“oraocci10d.lib”;
    2)把“oraocci10d.dll”拷贝到程序的Debug目录下;
    就OK了。当然,需要先下载occi对应vs2005的开发包。
      

  5.   

    我来告诉你原因吧 你先看一下你程序引用的LIB的那个目录下 也就是客户端安装目录下的OCI/LIB/MSVC文件夹下的动态库是哪个版本的 肯定和你的开发工具版本不一致,我估计你是用的VC6,然后客户端装的是10.2以后的版本,那么客户端的OCCI动态库支持的是VC7,也就是2003,你用vc6就会提示这个错误,因为引用的函数参数类型处理不一样了。
      

  6.   

    楼主我想请教一下您这个问题:我现在用的开发环境是VS2005+oracle 10R2版本,对应的是VC7和VC71,我想请问一下现在我遇到跟你同样的错误,应该怎么处理?
      

  7.   

    谢谢LZ,谢谢十楼的兄弟,的确是库文件引用错误!之前也查了很多资料,有的说让把oraocci10.lib删除掉,否则会有冲突,但引用的时候还是没注意啊!谢了!