SYBASE编程问题,急等。。。。。。
<p>编程环境AIX,CICS,语言C+数据库SYBASE ASE12.5</p><p>程序编译通过。</p><p>执行到 EXEC SQL CONNECT :USER IDENTIFIED BY :PASS;时候报错。</p><p>返回SQLCA.SQLCODE= -25001.SQLERRMSG :UNRECOVERABLE 。。。。。。</p><p>不知道这里有何问题。希望知道的TX能不吝赐教,谢谢!</p>[此贴子已经被作者于2006-3-20 19:52:59编辑过]
<p>-25001 Unrecoverable error occurred</p><p>Immediately report this error to sybase technical support</p><p>要不把你的OCS版本(isql -v )、程序贴出来看看?</p> 另外手工用isql -U -P -S -I 接口文件名 能连到ASE么? <p>Sybase CTISQL Utility/12.5.1/P-EBF12627 ESD #9/DRV.12.5.1.4/RS6000/AIX 4.3.3/BUI<br/>LD1251-042/OPT/Thu Jun 23 18:49:34 2005</p><p>Confidential property of Sybase, Inc.<br/>Copyright 1987, 2005<br/>Sybase, Inc. All rights reserved.<br/>Unpublished rights reserved under U.S. copyright laws.</p><p>This software contains confidential and trade secret information of Sybase,<br/>Inc. Use, duplication or disclosure of the software and documentation by<br/>the U.S. Government is subject to restrictions set forth in a license<br/>agreement between the Government and Sybase, Inc. or other written<br/>agreement specifying the Government's rights to use the software and any<br/>applicable FAR provisions, for example, FAR 52.227-19.<br/>Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA<br/></p><p>isql -U -P -S 可以登陆数据库</p><p>程序:</p><p>#include "head.h"</p><p>EXEC SQL INCLUDE sqlca;</p><p>unsigned long lRespCode;<br/>char*pCommArea;</p><p><br/>EXEC SQL BEGIN DECLARE SECTION;<br/>char WK_NAM;<br/>char DB_USER;<br/>char DB_PASS;<br/>char DB_SERVER;<br/>EXEC SQL END DECLARE SECTION;</p><p>int main()<br/>{<br/> char msgdata = "start ......";</p><p> printf("ARMS ARMO0001 START ...... \n");</p><p> EXEC CICS ADDRESS EIB(dfheiptr) RESP(lRespCode);<br/> if(lRespCode != DFHRESP(NORMAL))<br/> {<br/> fprintf(stderr,"Error occured addressing eib,rc=%ld\n", \<br/> lRespCode);<br/> EXEC CICS ABEND ABCODE("A001");<br/> EXEC CICS RETURN;<br/> }</p><p> EXEC CICS ADDRESS COMMAREA(pCommArea) RESP(lRespCode);<br/> if(lRespCode != DFHRESP(NORMAL))<br/> {<br/> fprintf(stderr,"Error occured addressing CommArea,rc=%d\n",\<br/> lRespCode);<br/> EXEC CICS ABEND ABCODE("A002");<br/> EXEC CICS RETURN;<br/> }</p><p> EXEC CICS<br/> WRITEQ TS QUEUE ("ARMO0001") FROM (msgdata)<br/> LENGTH(sizeof(msgdata));</p><p> fprintf(stderr,"CommArea from client is[%s]\n",pCommArea);</p><p> sprintf(pCommArea,"hello from server.\n");</p><p><br/> memset(WK_NAM,'\0',sizeof(WK_NAM));<br/> memset(DB_USER,'\0',sizeof(DB_USER));<br/> memset(DB_PASS,'\0',sizeof(DB_PASS));<br/> memset(DB_SERVER,'\0',sizeof(DB_SERVER));</p><p> strcpy(DB_USER,"aaaa");<br/> strcpy(DB_PASS,"aaaa");<br/> strcpy(DB_SERVER,"SYBASE");</p><p> EXEC SQL CONNECT :DB_USER IDENTIFIED BY :DB_PASS USING :DB_SERVER;<br/> if(sqlca.sqlcode != 0)<br/> {<br/> sprintf(pCommArea,"connect db err,rc1=[%ld],msg=[%s]\n",<br/> sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);<br/> EXEC CICS RETURN;<br/> }</p><p> EXEC SQL<br/> SELECT NAME INTO :WK_NAM<br/> FROM MYTEST<br/> WHERE TITID = 'bbb';<br/> if(sqlca.sqlcode != 0</p><p> {<br/> sprintf(pCommArea,"select db err,rc=[%d],msg=[%s]\n",<br/> sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);<br/> EXEC CICS RETURN;<br/> }<br/> else<br/> {<br/> sprintf(pCommArea,"select db ok ,result is [%s]\n",WK_NAM);<br/> }</p><p> EXEC CICS RETURN;<br/>}<br/>/* end of file */</p><p> </p>
[此贴子已经被作者于2006-3-21 14:00:19编辑过]
页:
[1]