连接代码不正确吧:
给你个例子
int connect_ora()
{
char username[10],password[10], server[10];
strcpy(username,USERNAME);/*USERNAME为宏,下同*/
strcpy(password,PASSWORD);
strcpy(server,SERVER);
EXEC SQL CONNECT :username IDENTIFIED BY :password USING :server;
if(sqlca.sqlcode==0)
{
            printf("连接成功!\n");
            return 0;
          }
else
{
printf("连接未成功\n");
return 1;
}
        return 0;
}

解决方案 »

  1.   

    ORA-12705 invalid or unknown NLS parameter value specified
    Cause: There are two possible causes: Either an attempt was made to issue an
    ALTER SESSION statement with an invalid NLS parameter or value; or the
    NLS_LANG environment variable contains an invalid language, territory, or
    character set.
    Action: Check the syntax of the ALTER SESSION statement and the NLS
    parameter, correct the syntax and retry the statement, or specify correct values
    in the NLS_LANG environment variable. For more information about the syntax
    of the ALTER SESSION statement, see the Oracle9i SQL Reference.
      

  2.   

    在pro*c中连接数据库时(并没有做alter session)就报ORA-12705,但用SQLPLUS没有问题啊.到底为什么?
      

  3.   

    我的连接代码跟wylwyl1130的类似啊
      

  4.   

    the NLS_LANG environment variable contains an invalid language, territory, or character set.