odbc error - need help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am using the Employee.fdb sample that comes with Firebird 1.5.1.
Everything resides on a WinXP Pro pc.  I set up an ODBC connection
called "FB Employee Sample" and tested it with MS Access and Brio; works
OKAY.  When I try to run the following script:


$conn=odbc_connect('FB Employee Sample','SYSDBA','masterkey');
if (!$conn)
exit("Connection Failed: " . $conn);
if (!$rs)
exit("Error in SQL");
echo "<table><tr>";
echo "<th>Employee Name</th>";
echo "<th>Employee ID</th></tr>";
while (odbc_fetch_row($rs))
$empname=odbc_result($rs,"Full Name");
echo "<tr><td>$empname</td>";
echo "<td>$empid</td></tr>";
echo "</table>";


this is waht I get in the browser window: "Warning: odbc_connect()
[function.odbc-connect]: SQL error: unavailable database, SQL state
08004 in SQLConnect in C:\Inetpub\test\odbc-test2.php on line 5
Connection Failed::.  Can someone please tell why this is not working in


Re: odbc error - need help

I'm only guessing to be honest but I'd be seriously tempted to change the
DSN name to something 8 characters or less and without spaces:

resource odbc_connect ( string dsn, string user, string password [, int
cursor_type] )

In your case:
$res = odbc_connect('fbsamp', 'SYSDBA', 'masterkey');

Give it a go.

Quoted text here. Click to load it

Site Timeline