连接代码不正确吧:
给你个例子
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;
}
给你个例子
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;
}
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.