Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

open client & php & ASE

2 posts in ,  Open ClientWindows NT Internet Last posting was on 2000-10-16 17:03:06.0Z
Thomas Posted on 2000-10-16 01:42:06.0Z
Message-ID: <39EA5CEE.D597769E@bigfoot.com>
Date: Mon, 16 Oct 2000 09:42:06 +0800
From: Thomas <tomcwh@bigfoot.com>
X-Mailer: Mozilla 4.72 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: open client & php & ASE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.connectivity.open_client,sybase.public.sqlserver.nt,sybase.public.sqlserver.internet
Lines: 33
NNTP-Posting-Host: pc28207.csc.cuhk.edu.hk 137.189.28.207
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.connectivity.open_client:2366 sybase.public.sqlserver.nt:193 sybase.public.sqlserver.internet:139
Article PK: 119704

I have a problem when using php to connect ASE via OpenClient.
But I dont which newsgroup that would be appropriate for me to post this
message. Anyway, I did, sorry for any inconvenience caused.

I configured a machine with php, pws and open client. Then the php
scripting engine seems working fine. And then I created a file named
"sybase.php" to test the connection between the php, open client and
ASE.
However, the return shows that there is something wrong with the ASE.
Afterward, I searched the manuals.sybase.com almost entirely for an
answer about the error message. But I got nothing, would someone can
help to me to solve it. Thanks.

The following shows that content of the sybase.php

<?php
$connect=sybase_connect("TEST","sa", "") or
die ("Could not connect to the sybase server!");
$selectdb=sybase_select_db("mydb",$connect) or die
("could not select db");
$clssybase=sybase_close($connect) or die
("Cound not close sysbase database server");
?>

The following shows the content of the error message.

Warning: Sybase: Server message: Changed database context to 'master'.
(severity 10, procedure N/A) in D:\Inetpub\wwwroot\cgi-bin\sybase.php on
line 4
PHP has encountered an Access Violation at 01FA03B3

Thomas
mailto:tomcwh@bigfoot.com


Jay Anderson Posted on 2000-10-16 17:03:06.0Z
From: janders@sybase.com (Jay Anderson)
Subject: Re: open client & php & ASE
Date: Mon, 16 Oct 2000 17:03:06 GMT
Message-ID: <39eb32ed.1641399593@forums.sybase.com>
References: <39EA5CEE.D597769E@bigfoot.com>
X-Newsreader: Forte Free Agent 1.11/32.235
Newsgroups: sybase.public.connectivity.open_client,sybase.public.sqlserver.nt,sybase.public.sqlserver.internet
Lines: 52
NNTP-Posting-Host: powerjay.sybase.com 157.133.10.202
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.connectivity.open_client:2365 sybase.public.sqlserver.nt:192 sybase.public.sqlserver.internet:138
Article PK: 119700

On Mon, 16 Oct 2000 09:42:06 +0800, Thomas <tomcwh@bigfoot.com> wrote:

Guessing but I suspect you have the wrong calling convention for the Sybase error message handler and the stack becomes corrupted in the call to the message handler.

The calling convention for openclient called functions is __stdcall.
So the error message handlers are defined like this:

CS_RETCODE CS_PUBLIC client_handlers(... etc ...)
on the NT platfrom CS_PUBLIC is defined : #define CS_PUBLIC __stdcall

This allows you to use whatever calling convention you want in your program but assures that the error handler will be calling properly. Use this calling convention for both the client and the server message callback() functions.

Jay

>I have a problem when using php to connect ASE via OpenClient.
>But I dont which newsgroup that would be appropriate for me to post this
>message. Anyway, I did, sorry for any inconvenience caused.
>
>I configured a machine with php, pws and open client. Then the php
>scripting engine seems working fine. And then I created a file named
>"sybase.php" to test the connection between the php, open client and
>ASE.
>However, the return shows that there is something wrong with the ASE.
>Afterward, I searched the manuals.sybase.com almost entirely for an
>answer about the error message. But I got nothing, would someone can
>help to me to solve it. Thanks.
>
>The following shows that content of the sybase.php
>
><?php
>$connect=sybase_connect("TEST","sa", "") or
>die ("Could not connect to the sybase server!");
>$selectdb=sybase_select_db("mydb",$connect) or die
>("could not select db");
>$clssybase=sybase_close($connect) or die
>("Cound not close sysbase database server");
>?>
>
>The following shows the content of the error message.
>
>Warning: Sybase: Server message: Changed database context to 'master'.
>(severity 10, procedure N/A) in D:\Inetpub\wwwroot\cgi-bin\sybase.php on
>line 4
>PHP has encountered an Access Violation at 01FA03B3
>
>Thomas
>mailto:tomcwh@bigfoot.com
>
>