mars_sun 发表于 2006-3-20 19:51:22

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编辑过]

ohyeah 发表于 2006-3-20 20:13:42

<p>-25001&nbsp; Unrecoverable error occurred</p><p>Immediately report this error to sybase technical support</p><p>要不把你的OCS版本(isql -v )、程序贴出来看看?</p>

ohyeah 发表于 2006-3-20 20:15:23

另外手工用isql -U -P -S&nbsp;&nbsp;-I 接口文件名&nbsp; 能连到ASE么?

mars_sun 发表于 2006-3-21 11:04:12

<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.&nbsp; 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.&nbsp;&nbsp; Use,&nbsp; duplication or disclosure of the software and documentation by<br/>the&nbsp; U.S.&nbsp; Government&nbsp; is&nbsp; subject&nbsp; to&nbsp; restrictions set forth in a license<br/>agreement&nbsp; between&nbsp; the&nbsp; Government&nbsp; and&nbsp; Sybase,&nbsp; Inc.&nbsp; or&nbsp; other&nbsp; written<br/>agreement&nbsp; specifying&nbsp; the&nbsp; 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&nbsp;&nbsp;&nbsp;&nbsp; WK_NAM;<br/>char&nbsp;&nbsp;&nbsp;&nbsp; DB_USER;<br/>char&nbsp;&nbsp;&nbsp;&nbsp; DB_PASS;<br/>char&nbsp;&nbsp;&nbsp;&nbsp; DB_SERVER;<br/>EXEC SQL END&nbsp;&nbsp; DECLARE SECTION;</p><p>int main()<br/>{<br/>&nbsp;&nbsp;&nbsp; char&nbsp; msgdata = "start ......";</p><p>&nbsp;&nbsp;&nbsp; printf("ARMS ARMO0001 START ...... \n");</p><p>&nbsp;&nbsp;&nbsp; EXEC CICS ADDRESS EIB(dfheiptr) RESP(lRespCode);<br/>&nbsp;&nbsp;&nbsp; if(lRespCode != DFHRESP(NORMAL))<br/>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr,"Error occured addressing eib,rc=%ld\n", \<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lRespCode);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC CICS ABEND ABCODE("A001");<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC CICS RETURN;<br/>&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp; EXEC CICS ADDRESS COMMAREA(pCommArea) RESP(lRespCode);<br/>&nbsp;&nbsp;&nbsp; if(lRespCode != DFHRESP(NORMAL))<br/>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr,"Error occured addressing CommArea,rc=%d\n",\<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lRespCode);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC CICS ABEND ABCODE("A002");<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC CICS RETURN;<br/>&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp; EXEC CICS<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WRITEQ TS QUEUE ("ARMO0001") FROM (msgdata)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LENGTH(sizeof(msgdata));</p><p>&nbsp;&nbsp;&nbsp; fprintf(stderr,"CommArea from client is[%s]\n",pCommArea);</p><p>&nbsp;&nbsp;&nbsp; sprintf(pCommArea,"hello from server.\n");</p><p><br/>&nbsp;&nbsp;&nbsp; memset(WK_NAM,'\0',sizeof(WK_NAM));<br/>&nbsp;&nbsp;&nbsp; memset(DB_USER,'\0',sizeof(DB_USER));<br/>&nbsp;&nbsp;&nbsp; memset(DB_PASS,'\0',sizeof(DB_PASS));<br/>&nbsp;&nbsp;&nbsp; memset(DB_SERVER,'\0',sizeof(DB_SERVER));</p><p>&nbsp;&nbsp;&nbsp; strcpy(DB_USER,"aaaa");<br/>&nbsp;&nbsp;&nbsp; strcpy(DB_PASS,"aaaa");<br/>&nbsp;&nbsp;&nbsp; strcpy(DB_SERVER,"SYBASE");</p><p>&nbsp;&nbsp;&nbsp; EXEC SQL CONNECT :DB_USER IDENTIFIED BY :DB_PASS USING :DB_SERVER;<br/>&nbsp;&nbsp;&nbsp; if(sqlca.sqlcode != 0)<br/>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sprintf(pCommArea,"connect db err,rc1=[%ld],msg=[%s]\n",<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC CICS RETURN;<br/>&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp; EXEC SQL<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT NAME INTO :WK_NAM<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM&nbsp;&nbsp; MYTEST<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE&nbsp; TITID = 'bbb';<br/>&nbsp;&nbsp;&nbsp; if(sqlca.sqlcode != 0</p><p>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sprintf(pCommArea,"select db err,rc=[%d],msg=[%s]\n",<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC CICS RETURN;<br/>&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp; else<br/>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sprintf(pCommArea,"select db ok ,result is [%s]\n",WK_NAM);<br/>&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;&nbsp;&nbsp; EXEC CICS RETURN;<br/>}<br/>/* end of file */</p><p>&nbsp;</p>
[此贴子已经被作者于2006-3-21 14:00:19编辑过]
页: [1]
查看完整版本: SYBASE编程问题,急等。。。。。。

免责声明:
本站所发布的一切破解补丁、注册机和注册信息及软件的解密分析文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:Admin@SybaseBbs.com