dbTalk Databases Forums  

Error while executing cs_ctx_alloc (returning CS_FAIL)

comp.databases.sybase comp.databases.sybase


Discuss Error while executing cs_ctx_alloc (returning CS_FAIL) in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Amol Natekar
 
Posts: n/a

Default Error while executing cs_ctx_alloc (returning CS_FAIL) - 07-09-2004 , 07:32 AM






Hi all,

I am programming Sybase using ct-library version 12.5.

While executing the cs_ctx_alloc command it results into an error returning CS_FAIL.
The command that i am excuting is as follows.
retcode = cs_ctx_alloc (CS_VERSION_125,cntx_ptr );
RETURN_IF( retcode, "cs_ctx_alloc ");
the command return 0(CS_FAIL). The version of sybase that is installed is 12.5.
Can anyone help me to find the cause of this problem.

Thanks in advance.

Reply With Quote
  #2  
Old   
Michael Peppler
 
Posts: n/a

Default Re: Error while executing cs_ctx_alloc (returning CS_FAIL) - 07-09-2004 , 08:50 AM






On Fri, 09 Jul 2004 05:32:33 -0700, Amol Natekar wrote:

Quote:
Hi all,

I am programming Sybase using ct-library version 12.5.

While executing the cs_ctx_alloc command it results into an error
returning CS_FAIL. The command that i am excuting is as follows.
retcode = cs_ctx_alloc (CS_VERSION_125,cntx_ptr ); RETURN_IF( retcode,
"cs_ctx_alloc ");
the command return 0(CS_FAIL). The version of sybase that is installed is
12.5. Can anyone help me to find the cause of this problem.
Install an error handler (client callback). This should give you the
reason for the failure.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler (AT) peppler (DOT) org http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.peppler.org/resume.html



Reply With Quote
  #3  
Old   
Amol Natekar
 
Posts: n/a

Default Re: Error while executing cs_ctx_alloc (returning CS_FAIL) - 07-12-2004 , 03:52 AM



Hello Sir,
First of all I would like to thanks for your reply.
But the problem I am facing is only when I integrate the code with
an MFC code,else in a console based application it runs perfectly.
Also the error comes while initializing the context,and I had read
somewhere that client and server message handlers(callback functions)
can be set only after initializing the context structure(Help me if
I'm wrong here).
So what might be the cause of the problem.

Waiting for your reply.....
Thanks again....

Regards,
Amol Natekar



Michael Peppler <mpeppler (AT) peppler (DOT) org> wrote

Quote:
On Fri, 09 Jul 2004 05:32:33 -0700, Amol Natekar wrote:

Hi all,

I am programming Sybase using ct-library version 12.5.

While executing the cs_ctx_alloc command it results into an error
returning CS_FAIL. The command that i am excuting is as follows.
retcode = cs_ctx_alloc (CS_VERSION_125,cntx_ptr ); RETURN_IF( retcode,
"cs_ctx_alloc ");
the command return 0(CS_FAIL). The version of sybase that is installed is
12.5. Can anyone help me to find the cause of this problem.

Install an error handler (client callback). This should give you the
reason for the failure.

Michael

Reply With Quote
  #4  
Old   
Neal
 
Posts: n/a

Default Re: Error while executing cs_ctx_alloc (returning CS_FAIL) - 07-12-2004 , 10:24 AM



Hello,

Try searching your PC for duplicate Sybase dll's like
libct.dll, libcs.dll, libcomn.dll, libblk.dll, etc.

If your application picks up an old dll it won't be
able to initialize the context to CS_VERSION_125.

I'm not sure what you do differently to integrate with MFC
but if the application can not find the Sybase dll's, that
could also cause this type of error.

Good luck,
Neal

Reply With Quote
  #5  
Old   
Amol Natekar
 
Posts: n/a

Default Re: Error while executing cs_ctx_alloc (returning CS_FAIL) - 07-14-2004 , 01:23 AM



Hi,

I had searched my machine for existance of any other dll's but haven't
found any of them except in sybase directory where the libraries are
installed.
Can you suggest me any other reasons for this problems.

Thanks for replying.

Regards,
Amol

lucky_justin69 (AT) yahoo (DOT) com (Neal) wrote in message news:<498321de.0407120724.1df88c91 (AT) posting (DOT) google.com>...
Quote:
Hello,

Try searching your PC for duplicate Sybase dll's like
libct.dll, libcs.dll, libcomn.dll, libblk.dll, etc.

If your application picks up an old dll it won't be
able to initialize the context to CS_VERSION_125.

I'm not sure what you do differently to integrate with MFC
but if the application can not find the Sybase dll's, that
could also cause this type of error.

Good luck,
Neal

Reply With Quote
  #6  
Old   
Neal
 
Posts: n/a

Default Re: Error while executing cs_ctx_alloc (returning CS_FAIL) - 07-14-2004 , 09:04 AM



Hello,

I'm still not sure what is different about your program/environment
when you compile it as an MFC versus console application. Perhaps
it can not find the Sybase dll's.

When you run your application, does it create a "sybinit.err"?
This file is created by default when the Sybase software can not
initialize properly:
================================================== =================
C:\Neal\Firstapp\Debug> firstapp.exe

C:\Neal\Firstapp\Debug> type sybinit.err


The context allocation routine failed.

The following problem caused the failure:

Invalid context version.

Open Client Message:
Message number: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER = (131)
Message String: ct_init(): network packet layer: internal net library error: Fai
led to open Net-Library localization file
================================================== =================
In the above example, I changed my PATH to exclude the
Sybase directory containing the Sybase dll's.

If this doesn't help, perhaps you can zip up a simplified
version of your project and send it to Sybase technical
support?

Thanks,
Neal

Reply With Quote
  #7  
Old   
Amol Natekar
 
Posts: n/a

Default Re: Error while executing cs_ctx_alloc (returning CS_FAIL) - 07-20-2004 , 07:51 AM



HI,

I had just reinstalled my sybase libraries and the things are working
now. I guess it was the same problem that you suggested me in your
first reply(existence of duplicate dll's).
Thanks for your time and suggestions.

Regards,
Amol

lucky_justin69 (AT) yahoo (DOT) com (Neal) wrote in message news:<498321de.0407140604.14b19b82 (AT) posting (DOT) google.com>...
Quote:
Hello,

I'm still not sure what is different about your program/environment
when you compile it as an MFC versus console application. Perhaps
it can not find the Sybase dll's.

When you run your application, does it create a "sybinit.err"?
This file is created by default when the Sybase software can not
initialize properly:
================================================== =================
C:\Neal\Firstapp\Debug> firstapp.exe

C:\Neal\Firstapp\Debug> type sybinit.err


The context allocation routine failed.

The following problem caused the failure:

Invalid context version.

Open Client Message:
Message number: LAYER = (5) ORIGIN = (3) SEVERITY = (5) NUMBER = (131)
Message String: ct_init(): network packet layer: internal net library error: Fai
led to open Net-Library localization file
================================================== =================
In the above example, I changed my PATH to exclude the
Sybase directory containing the Sybase dll's.

If this doesn't help, perhaps you can zip up a simplified
version of your project and send it to Sybase technical
support?

Thanks,
Neal

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.