RE: [PHP-DB] error message when preparing and executing an odbc_exec() in php3
| From: | Andrew Hill | Date: | Fri, 07 Jul 2000 19:35:58 +0000 |
| Subject: | RE: [PHP-DB] error message when preparing and executing an odbc_exec() in php3 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-962@lists.php.net to get a copy of this message | ||
Ryan,
I seem to remember that you are trying to connect to a SQLServer 7 database.
I'm not sure what is causing your problem, but I bet you could remove one
layer by getting rid of the SQL Server native layer.
Lots of people have been asking me how to connect to Access and Interbase,
etc, which Openlink doesn't directly support, so I've been recommending a
piggyback method with the comm layers.
You, however, don't need to piggyback.
Change the ServiceType in your odbc.ini DSN from ODBC to SQLServer 7
Change the Database name from the the name of the Windows-side DSN to the
acutal name of the database.
Hope this helps; if not, feel free to open a support case at our website.
Best regards,
Andrew
----------------------------------------------------
Andrew Hill
Professional Services Consultant
OpenLink Software
http://www.openlinksw.com
Universal Database Connectivity Technology Providers
-----Original Message-----
From: Conover, Ryan [mailto:Rconover@americanbridge.net]
Sent: Friday, July 07, 2000 1:24 PM
To: 'php-db@lists.php.net'
Subject: [PHP-DB] error message when preparing and executing an
odbc_exec() in php3
I keep getting the following error message.
Warning: SQL error: [OpenLink][ODBC][Microsoft][ODBC SQL Server Driver][SQL
Server]Statement(s) could not be prepared., SQL state S1000 in SQLExecDirect
in /Intranet/projs/jobsearch.php on line 41
statement was executed
Here is my code.
<?php
putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib");
putenv("ODBCINSTINI=/usr/local/openlink/bin/odbcinst.ini");
putenv("ODBCINI=/usr/local/openlink/bin/odbc.ini");
$dsn="DSN=Joblist";
$user="Inetadmin";
$password="Inetadmin";
if ($conn_id=odbc_connect("$dsn","$user","$password")){
$query="SELECT From Joblist WHERE JOB_NO = $number";
$work=odbc_exec($conn_id,$query);
if($work="true"){
echo("statement was executed");
}
else{
echo("did not work");
}
}
else{
echo ("A connection to the database could not be made please try again");
}
?>
If anyone has any ideas why let me know.
Ryan
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net