php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5332 ODBC Connect Fails for Sybase SQLanywhere DB
Submitted: 2000-07-02 22:50 UTC Modified: 2001-07-02 18:02 UTC
From: wade at wadejohnson dot de Assigned: joey (profile)
Status: Closed Package: ODBC related
PHP Version: 4.0 Release Candidate 2 OS: Windows 2000
Private report: No CVE-ID: None
 [2000-07-02 22:50 UTC] wade at wadejohnson dot de
Hello,

when I attempt to connect to my Sybase SQLAnywhere DB over ODBC and PHP4, I receive the following message:

Warning: SQL error: [Sybase][ODBC Driver]Unable to connect to database server: invalid database engine command line, SQL state 08001 in SQLConnect in c:\daten\johnsonw\inetpub\wwwroot\ht\phptest\odbc2.php on line 9

The ODBC datasource, however, is properly configured.  I can connect to the datasource using any other ODBC supported product like Excel, Borland C++ Builder 5, etc.  In addition, I can connect to other ODBC datasources using PHP4, just not the Sybase SQLAnywhere DB.  Any ideas?

Regards,

Wade Johnson

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-27 20:24 UTC] waldschrott@php.net
Please verify that it?s still happening using the latest version of PHP (release 4.0.1pl2 or CVS).
 [2000-07-28 11:51 UTC] waldschrott@php.net
user feedback: still happening
 [2000-07-28 11:59 UTC] kara@php.net
Please make shure that the user account running php scripts (probably IUSR_XXX) can actually access your dsn.
 [2001-03-23 16:59 UTC] kalowsky@php.net
is this still occuring in the current CVS?
 [2001-03-26 16:22 UTC] wade at wadejohnson dot de
Yes, this is still happening.  I have loaded PHP version 4.04 PL1.  I am trying to run the following simple script:

---------------------------------------------------------
<html>

<head>
<title>Neue Seite 2</title>
</head>

<body>

<?php

$connect = odbc_connect("wadlserv - wadl","johnsonw","password");
echo "Odbc connection variable:  $connect";
$returncode = odbc_exec($connect, "select * from testtable;");
echo $returncode;
odbc_close($connect);
$date = date("m.d.Y G:i:s T");
echo $date;

?>
</body>

</html>

--------------------------------------------------------
The output I receive is:

Warning: SQL error: [Sybase][ODBC Driver]Unable to connect to database server: unable to start database engine, SQL state 08001 in SQLConnect in c:\inetpub\wwwroot\odbctest\default.php on line 11
Odbc connection variable: 
Warning: Supplied argument is not a valid ODBC-Link resource in c:\inetpub\wwwroot\odbctest\default.php on line 13

Warning: Supplied argument is not a valid ODBC-Link resource in c:\inetpub\wwwroot\odbctest\default.php on line 15

Warning: Supplied argument is not a valid ODBC-Link resource in c:\inetpub\wwwroot\odbctest\default.php on line 15
03.26.2001 22:50:23 Westeurop?ische Normalzeit 

---------------------------------------------------------
I have enabled the ODBC log.  However, the log shows absolutely nothing for this ODBC connection attempt via PHP.  I can connect via Excel and Borland DB explorer for example.  Here are excerpts from the odbc logs:

ODBC via Excel:

MSQRY32         5ac-850	ENTER SQLDriverConnectW 
		HDBC                00811910
		HWND                00020564
		WCHAR *             0x1F7D8B70 [      -3] "******\ 0"
		SWORD                       -3 
		WCHAR *             0x1F7D8B70 
		SWORD                        8 
		SWORD *             0x00000000
		UWORD                        1 <SQL_DRIVER_COMPLETE>

MSQRY32         5ac-850	EXIT  SQLDriverConnectW  with return code 0 (SQL_SUCCESS)
		HDBC                00811910
		HWND                00020564
		WCHAR *             0x1F7D8B70 [      -3] "******\ 0"
		SWORD                       -3 
		WCHAR *             0x1F7D8B70 
		SWORD                        8 
		SWORD *             0x00000000
		UWORD                        1 <SQL_DRIVER_COMPLETE>

MSQRY32         5ac-850	ENTER SQLGetInfoW 
		HDBC                00811910
		UWORD                        2 <SQL_DATA_SOURCE_NAME>
		PTR                 0x00811A40 
		SWORD                     2048 
		SWORD *             0x0006EF96

MSQRY32         5ac-850	EXIT  SQLGetInfoW  with return code 0 (SQL_SUCCESS)
		HDBC                00811910
		UWORD                        2 <SQL_DATA_SOURCE_NAME>
		PTR                 0x00811A40 [      30] "wadlserv - wadl"
		SWORD                     2048 
		SWORD *             0x0006EF96 (30)


--------------------------------------------------------

ODBC from Borland DB Explorer:
dbexplor        88c-850	EXIT  SQLDataSourcesW  with return code 0 (SQL_SUCCESS)
		HENV                02B314F0
		UWORD                        1 <SQL_FETCH_NEXT>
		WCHAR *             0x02B31658 [      15] "wadlser"
		SWORD                       33 
		SWORD *             0x0012EFAA (15)
		WCHAR *             0x02B322E8 [      23] "Sybase SQL "
		SWORD                      257 
		SWORD *             0x0012EFA8 (23)

dbexplor        88c-850	ENTER SQLAllocConnect 
		HENV                02B314F0
		HDBC *              013386EC

dbexplor        88c-850	EXIT  SQLAllocConnect  with return code 0 (SQL_SUCCESS)
		HENV                02B314F0
		HDBC *              0x013386EC ( 0x02b316b0)

dbexplor        88c-850	ENTER SQLConnectW 
		HDBC                02B316B0
		WCHAR *             0x02B317B8 [      -3] "wadlserv - wadl\ 0"
		SWORD                       -3 
		WCHAR *             0x1F7D8B70 [      -3] "******\ 0"
		SWORD                       -3 
		WCHAR *             0x1F7D8B70 [      -3] "******\ 0"
		SWORD                       -3 

dbexplor        88c-850	EXIT  SQLConnectW  with return code 0 (SQL_SUCCESS)
		HDBC                02B316B0
		WCHAR *             0x02B317B8 [      -3] "wadlserv - wadl\ 0"
		SWORD                       -3 
		WCHAR *             0x1F7D8B70 [      -3] "******\ 0"
		SWORD                       -3 
		WCHAR *             0x1F7D8B70 [      -3] "******\ 0"
		SWORD                       -3 

----------------------------------------------------------
Here is the phpinfo() function output for my setup:

PHP Version 4.0.4pl1 

System Windows NT 5.0 build 2195 
Build Date Jan 12 2001 
Server API CGI 
Virtual Directory Support enabled 
Configuration File (php.ini) Path php.ini 
ZEND_DEBUG disabled 
Thread Safety enabled 

 This program makes use of the Zend scripting language engine:
Zend Engine v1.0.4, Copyright (c) 1998-2000 Zend Technologies

 


--------------------------------------------------------------------------------

PHP 4.0 Credits

--------------------------------------------------------------------------------

Configuration
PHP Core 
Directive Local Value Master Value 
allow_call_time_pass_reference
 On On 
allow_url_fopen
 1 1 
arg_separator
 & & 
asp_tags
 Off Off 
auto_append_file
 no value no value 
auto_prepend_file
 no value no value 
browscap
 no value no value 
default_charset
 no value no value 
default_mimetype
 text/html text/html 
define_syslog_variables
 Off Off 
disable_functions
 no value no value 
display_errors
 On On 
display_startup_errors
 Off Off 
doc_root
 no value no value 
enable_dl
 On On 
error_append_string
 Off Off 
error_log
 no value no value 
error_prepend_string
 Off Off 
error_reporting
 2047 2047 
expose_php
 On On 
extension_dir
 c:\php\extensions\ c:\php\extensions\ 
file_uploads
 1 1 
gpc_order
 GPC GPC 
highlight.bg
 #FFFFFF #FFFFFF 
highlight.comment
 #FF8000 #FF8000 
highlight.default
 #0000BB #0000BB 
highlight.html
 #000000 #000000 
highlight.keyword
 #007700 #007700 
highlight.string
 #DD0000 #DD0000 
html_errors
 On On 
ignore_user_abort
 Off Off 
implicit_flush
 Off Off 
include_path
 no value no value 
log_errors
 Off Off 
magic_quotes_gpc
 On On 
magic_quotes_runtime
 Off Off 
magic_quotes_sybase
 Off Off 
max_execution_time
 30 30 
open_basedir
 no value no value 
output_buffering
 Off Off 
output_handler
 no value no value 
post_max_size
 8M 8M 
precision
 14 14 
register_argc_argv
 On On 
register_globals
 On On 
safe_mode
 Off Off 
safe_mode_exec_dir
 no value no value 
sendmail_from
 me@localhost.com me@localhost.com 
sendmail_path
 no value no value 
short_open_tag
 On On 
SMTP
 localhost localhost 
sql.safe_mode
 Off Off 
track_errors
 Off Off 
upload_max_filesize
 2M 2M 
upload_tmp_dir
 C:\PHP\uploadtemp C:\PHP\uploadtemp 
user_dir
 no value no value 
variables_order
 EGPCS EGPCS 
y2k_compliance
 Off Off 


interbase
Interbase Support enabled 
Revision $Revision: 1.48 $ 
Dynamic Module yes 
Allow Persistent Links Yes 
Persistent Links 0/unlimited 
Total Links 0/unlimited 
Timestamp Format %m/%d/%Y %H:%M:%S 
Date Format %m/%d/%Y 
Time Format %H:%M:%S 


pdf
PDF Support enabled 
PDFLib Version 3.03 
CJK Font Support yes 
In-memory PDF Creation Support yes 


standard
Regex Library Bundled library enabled 
Dynamic Library Support enabled 
Internal Sendmail Support for Windows 4 enabled 

Directive Local Value Master Value 
assert.active
 1 1 
assert.bail
 0 0 
assert.callback
 no value no value 
assert.quiet_eval
 0 0 
assert.warning
 1 1 
safe_mode_allowed_env_vars
 PHP_ PHP_ 
safe_mode_protected_env_vars
 LD_LIBRARY_PATH LD_LIBRARY_PATH 
session.use_trans_sid
 1 1 
url_rewriter.tags
 a=href,area=href,frame=src,form=fakeentry a=href,area=href,frame=src,form=fakeentry 


bcmath
BCMath support enabled 


Calendar
Calendar support enabled 


com
Directive Local Value Master Value 
allow_dcom
 Off Off 
typelib_file
 no value no value 


ftp
FTP support enabled 


mysql
MySQL Support enabled 
Active Persistent Links 0 
Active Links 0 
Client API version 3.23.22-beta 

Directive Local Value Master Value 
mysql.allow_persistent
 On On 
mysql.default_host
 no value no value 
mysql.default_password
 no value no value 
mysql.default_port
 no value no value 
mysql.default_socket
 no value no value 
mysql.default_user
 no value no value 
mysql.max_links
 Unlimited Unlimited 
mysql.max_persistent
 Unlimited Unlimited 


odbc
ODBC Support enabled 
Active Persistent Links 0 
Active Links 0 
ODBC library Win32 

Directive Local Value Master Value 
odbc.allow_persistent
 On On 
odbc.check_persistent
 On On 
odbc.default_db
 no value no value 
odbc.default_pw
   
odbc.default_user
 no value no value 
odbc.defaultbinmode
 return as is return as is 
odbc.defaultlrl
 return up to 4096 bytes return up to 4096 bytes 
odbc.max_links
 Unlimited Unlimited 
odbc.max_persistent
 Unlimited Unlimited 


pcre
PCRE (Perl Compatible Regular Expressions) Support enabled 
PCRE Library Version 3.1 09-Feb-2000 


session
Session Support enabled 

Directive Local Value Master Value 
session.auto_start
 Off Off 
session.cache_expire
 180 180 
session.cache_limiter
 nocache nocache 
session.cookie_domain
 no value no value 
session.cookie_lifetime
 0 0 
session.cookie_path
 / / 
session.cookie_secure
 Off Off 
session.entropy_file
 no value no value 
session.entropy_length
 0 0 
session.gc_maxlifetime
 1440 1440 
session.gc_probability
 1 1 
session.name
 PHPSESSID PHPSESSID 
session.referer_check
 no value no value 
session.save_handler
 files files 
session.save_path
 C:\PHP\sessiondata C:\PHP\sessiondata 
session.serialize_handler
 php php 
session.use_cookies
 On On 


xml
XML Support active 


wddx
WDDX Support enabled 


Additional Modules


Environment
Variable Value 
ALLUSERSPROFILE C:\Dokumente und Einstellungen\All Users 
CommonProgramFiles C:\Programme\Gemeinsame Dateien 
COMPUTERNAME WADL 
ComSpec C:\WINNT\system32\cmd.exe 
CONTENT_LENGTH 0 
GATEWAY_INTERFACE CGI/1.1 
HTTP_ACCEPT */* 
HTTP_ACCEPT_LANGUAGE de 
HTTP_CONNECTION Keep-Alive 
HTTP_HOST wadl 
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) 
HTTP_COOKIE ASPSESSIONIDGGGQGNBY=MBIFJLJAKEKDEEJALLCFEAGD 
HTTP_ACCEPT_ENCODING gzip, deflate 
HTTPS off 
INSTANCE_ID 1 
LOCAL_ADDR 127.0.0.1 
NUMBER_OF_PROCESSORS 1 
Os2LibPath C:\WINNT\system32\os2\dll; 
OS Windows_NT 
Path C:\Perl\bin\;C:\PROGRA~1\Borland\CBUILD~1\Projects\Bpl;C:\PROGRA~1\Borland\CBUILD~1\Bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;c:\sybtools\win32;c:\programme\php4; 
PATH_INFO /odbctest/default.php 
PATH_TRANSLATED c:\inetpub\wwwroot\odbctest\default.php 
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH 
PROCESSOR_ARCHITECTURE x86 
PROCESSOR_IDENTIFIER x86 Family 6 Model 3 Stepping 4, GenuineIntel 
PROCESSOR_LEVEL 6 
PROCESSOR_REVISION 0304 
ProgramFiles C:\Programme 
REMOTE_ADDR 127.0.0.1 
REMOTE_HOST 127.0.0.1 
REQUEST_METHOD GET 
SCRIPT_NAME /odbctest/default.php 
SERVER_NAME wadl 
SERVER_PORT 80 
SERVER_PORT_SECURE 0 
SERVER_PROTOCOL HTTP/1.1 
SERVER_SOFTWARE Microsoft-IIS/5.0 
SystemDrive C: 
SystemRoot C:\WINNT 
TEMP C:\WINNT\TEMP 
TMP C:\WINNT\TEMP 
USERPROFILE C:\Dokumente und Einstellungen\Default User 
windir C:\WINNT 


PHP Variables
Variable Value 
PHP_SELF /odbctest/default.php 
HTTP_COOKIE_VARS["ASPSESSIONIDGGGQGNBY"] MBIFJLJAKEKDEEJALLCFEAGD 
HTTP_SERVER_VARS["ALLUSERSPROFILE"] C:\\Dokumente und Einstellungen\\All Users 
HTTP_SERVER_VARS["CommonProgramFiles"] C:\\Programme\\Gemeinsame Dateien 
HTTP_SERVER_VARS["COMPUTERNAME"] WADL 
HTTP_SERVER_VARS["ComSpec"] C:\\WINNT\\system32\\cmd.exe 
HTTP_SERVER_VARS["CONTENT_LENGTH"] 0 
HTTP_SERVER_VARS["GATEWAY_INTERFACE"] CGI/1.1 
HTTP_SERVER_VARS["HTTP_ACCEPT"] */* 
HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"] de 
HTTP_SERVER_VARS["HTTP_CONNECTION"] Keep-Alive 
HTTP_SERVER_VARS["HTTP_HOST"] wadl 
HTTP_SERVER_VARS["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) 
HTTP_SERVER_VARS["HTTP_COOKIE"] ASPSESSIONIDGGGQGNBY=MBIFJLJAKEKDEEJALLCFEAGD 
HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] gzip, deflate 
HTTP_SERVER_VARS["HTTPS"] off 
HTTP_SERVER_VARS["INSTANCE_ID"] 1 
HTTP_SERVER_VARS["LOCAL_ADDR"] 127.0.0.1 
HTTP_SERVER_VARS["NUMBER_OF_PROCESSORS"] 1 
HTTP_SERVER_VARS["Os2LibPath"] C:\\WINNT\\system32\\os2\\dll; 
HTTP_SERVER_VARS["OS"] Windows_NT 
HTTP_SERVER_VARS["Path"] C:\\Perl\\bin\\;C:\\PROGRA~1\\Borland\\CBUILD~1\\Projects\\Bpl;C:\\PROGRA~1\\Borland\\CBUILD~1\\Bin;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;c:\\sybtools\\win32;c:\\programme\\php4; 
HTTP_SERVER_VARS["PATH_INFO"] /odbctest/default.php 
HTTP_SERVER_VARS["PATH_TRANSLATED"] c:\\inetpub\\wwwroot\\odbctest\\default.php 
HTTP_SERVER_VARS["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH 
HTTP_SERVER_VARS["PROCESSOR_ARCHITECTURE"] x86 
HTTP_SERVER_VARS["PROCESSOR_IDENTIFIER"] x86 Family 6 Model 3 Stepping 4, GenuineIntel 
HTTP_SERVER_VARS["PROCESSOR_LEVEL"] 6 
HTTP_SERVER_VARS["PROCESSOR_REVISION"] 0304 
HTTP_SERVER_VARS["ProgramFiles"] C:\\Programme 
HTTP_SERVER_VARS["REMOTE_ADDR"] 127.0.0.1 
HTTP_SERVER_VARS["REMOTE_HOST"] 127.0.0.1 
HTTP_SERVER_VARS["REQUEST_METHOD"] GET 
HTTP_SERVER_VARS["SCRIPT_NAME"] /odbctest/default.php 
HTTP_SERVER_VARS["SERVER_NAME"] wadl 
HTTP_SERVER_VARS["SERVER_PORT"] 80 
HTTP_SERVER_VARS["SERVER_PORT_SECURE"] 0 
HTTP_SERVER_VARS["SERVER_PROTOCOL"] HTTP/1.1 
HTTP_SERVER_VARS["SERVER_SOFTWARE"] Microsoft-IIS/5.0 
HTTP_SERVER_VARS["SystemDrive"] C: 
HTTP_SERVER_VARS["SystemRoot"] C:\\WINNT 
HTTP_SERVER_VARS["TEMP"] C:\\WINNT\\TEMP 
HTTP_SERVER_VARS["TMP"] C:\\WINNT\\TEMP 
HTTP_SERVER_VARS["USERPROFILE"] C:\\Dokumente und Einstellungen\\Default User 
HTTP_SERVER_VARS["windir"] C:\\WINNT 
HTTP_SERVER_VARS["PHP_SELF"] /odbctest/default.php 
HTTP_SERVER_VARS["argv"] Array
(
)

 
HTTP_SERVER_VARS["argc"] 0 
HTTP_ENV_VARS["ALLUSERSPROFILE"] C:\\Dokumente und Einstellungen\\All Users 
HTTP_ENV_VARS["CommonProgramFiles"] C:\\Programme\\Gemeinsame Dateien 
HTTP_ENV_VARS["COMPUTERNAME"] WADL 
HTTP_ENV_VARS["ComSpec"] C:\\WINNT\\system32\\cmd.exe 
HTTP_ENV_VARS["CONTENT_LENGTH"] 0 
HTTP_ENV_VARS["GATEWAY_INTERFACE"] CGI/1.1 
HTTP_ENV_VARS["HTTP_ACCEPT"] */* 
HTTP_ENV_VARS["HTTP_ACCEPT_LANGUAGE"] de 
HTTP_ENV_VARS["HTTP_CONNECTION"] Keep-Alive 
HTTP_ENV_VARS["HTTP_HOST"] wadl 
HTTP_ENV_VARS["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) 
HTTP_ENV_VARS["HTTP_COOKIE"] ASPSESSIONIDGGGQGNBY=MBIFJLJAKEKDEEJALLCFEAGD 
HTTP_ENV_VARS["HTTP_ACCEPT_ENCODING"] gzip, deflate 
HTTP_ENV_VARS["HTTPS"] off 
HTTP_ENV_VARS["INSTANCE_ID"] 1 
HTTP_ENV_VARS["LOCAL_ADDR"] 127.0.0.1 
HTTP_ENV_VARS["NUMBER_OF_PROCESSORS"] 1 
HTTP_ENV_VARS["Os2LibPath"] C:\\WINNT\\system32\\os2\\dll; 
HTTP_ENV_VARS["OS"] Windows_NT 
HTTP_ENV_VARS["Path"] C:\\Perl\\bin\\;C:\\PROGRA~1\\Borland\\CBUILD~1\\Projects\\Bpl;C:\\PROGRA~1\\Borland\\CBUILD~1\\Bin;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;c:\\sybtools\\win32;c:\\programme\\php4; 
HTTP_ENV_VARS["PATH_INFO"] /odbctest/default.php 
HTTP_ENV_VARS["PATH_TRANSLATED"] c:\\inetpub\\wwwroot\\odbctest\\default.php 
HTTP_ENV_VARS["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH 
HTTP_ENV_VARS["PROCESSOR_ARCHITECTURE"] x86 
HTTP_ENV_VARS["PROCESSOR_IDENTIFIER"] x86 Family 6 Model 3 Stepping 4, GenuineIntel 
HTTP_ENV_VARS["PROCESSOR_LEVEL"] 6 
HTTP_ENV_VARS["PROCESSOR_REVISION"] 0304 
HTTP_ENV_VARS["ProgramFiles"] C:\\Programme 
HTTP_ENV_VARS["REMOTE_ADDR"] 127.0.0.1 
HTTP_ENV_VARS["REMOTE_HOST"] 127.0.0.1 
HTTP_ENV_VARS["REQUEST_METHOD"] GET 
HTTP_ENV_VARS["SCRIPT_NAME"] /odbctest/default.php 
HTTP_ENV_VARS["SERVER_NAME"] wadl 
HTTP_ENV_VARS["SERVER_PORT"] 80 
HTTP_ENV_VARS["SERVER_PORT_SECURE"] 0 
HTTP_ENV_VARS["SERVER_PROTOCOL"] HTTP/1.1 
HTTP_ENV_VARS["SERVER_SOFTWARE"] Microsoft-IIS/5.0 
HTTP_ENV_VARS["SystemDrive"] C: 
HTTP_ENV_VARS["SystemRoot"] C:\\WINNT 
HTTP_ENV_VARS["TEMP"] C:\\WINNT\\TEMP 
HTTP_ENV_VARS["TMP"] C:\\WINNT\\TEMP 
HTTP_ENV_VARS["USERPROFILE"] C:\\Dokumente und Einstellungen\\Default User 
HTTP_ENV_VARS["windir"] C:\\WINNT 


PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE 

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net. 
 

----------------------------------------------------------
Please let me know if I can provide you with any additional information.

 [2001-05-16 19:01 UTC] kalowsky@php.net
The SQL error you are receiving is "Server rejected access"
I'm wondering if your odbc_connect only needs "wald" instead
of "waldserver - wald"


 [2001-05-17 04:48 UTC] wade at wadejohnson dot de
The first parameter of the odbc_connect function call is datasource name.  If I don't supply a valid datasource name as maintained in the odbc datasource administrator, I receive the following error message:

Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\Inetpub\wwwroot\wj\sqlanywhere.php on line 16

If I provide a valid datasource name, I receive the following error message:

Warning: SQL error: [Sybase][ODBC Driver]Unable to connect to database server: database engine not running, SQL state 08001 in SQLConnect in C:\Inetpub\wwwroot\wj\sqlanywhere.php on line 16

Please note once again.  THE VERY SAME datasource definition can be used to connect to the database via Excel or Borland C++, etc.
 [2001-06-26 17:53 UTC] kalowsky@php.net
assigning to joey as he knows Sybase rather well, and 
well... I don't.  :\  Plus he has it installed... 
 [2001-07-02 18:02 UTC] wade at wadejohnson dot de
Hello All!

I just tested the odbc connection to Sybase SQLAnywhere using PHP 4.0.6.  I am happy to report that I was able to connect to the database and retrieve data via the odbc function calls.

Thank you for your continued review and enhancements.

Regards,

Wade Johnson
 [2002-11-21 15:55 UTC] vcastle at vet dot una dot py
Well the same problem I solved this way:

1. Make on ODBC a DNS = databasename ; ex. dns = mydb and database = mydb
2. Run database ASA engine 
3. Using this (or any other) in the file.php

$connect = odbc_connect("mydb","user","password");
	echo "connection:  $connect";
	if  ($connect  <=  0)  {
		echo "Error  in  connection";
		exit;
	} else  {
		echo  "Connection  successful\n";
	};
It Works...!!!

*** BUT THEN... 
Warning: SQL error: [Sybase][ODBC Driver][Adaptive Server Anywhere]Table or view not found:Table "table" not found
Any suggestions??
 [2014-08-21 12:51 UTC] sean at seanco dot ca
Hello,

I know this is 12 years later. For those out there having the "Engine not started" or "Unable to start engine" error:

If getting "Unable to start engine" it means you are trying to start the engine with PHP and it is already running. You should be using the client (dbclient.exe). You setup a System ODBC string, and then use that in your ODBC connect function [ie. odbc_connect('ODBCNAME', 'user', 'passwprd'); ] 

Keep it simple. Finally, if getting the "Engine not running" or "Engine not started", it's because the client is already running on your local machine. You need to stop it in the task manager and then try. If you need the client running on that machine at all times, and need to connect from IIS/Apache, then you need to setup a second machine and install Sybase SQL Anywhere on that machine and run the client from there. You cannot have two clients/engines running on the same server (properly).

Enjoy!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC