473,578 Members | 3,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

odbc error - need help

Dan
Hi,

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:

*************** ************
<html>
<body>

<?php
$conn=odbc_conn ect('FB Employee Sample','SYSDBA ','masterkey');
if (!$conn)
{
exit("Connectio n Failed: " . $conn);
}
$sql="SELECT * FROM EMPLOYEES";
$rs=odbc_exec($ conn,$sql);
if (!$rs)
{
exit("Error in SQL");
}
echo "<table><tr >";
echo "<th>Employ ee Name</th>";
echo "<th>Employ ee ID</th></tr>";
while (odbc_fetch_row ($rs))
{
$empname=odbc_r esult($rs,"Full Name");
$empid=odbc_res ult($rs,"Contac tName");
echo "<tr><td>$empna me</td>";
echo "<td>$empid </td></tr>";
}
odbc_close($con n);
echo "</table>";
?>

</body>
</html>
*************** ************

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
PHP?

TIA,
Dan

Jul 17 '05 #1
1 4260
LJR
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('f bsamp', 'SYSDBA', 'masterkey');

Give it a go.

"Dan" <da*@nospam.com > wrote in message
news:u9******** *******@news.us west.net...
Hi,

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:

*************** ************
<html>
<body>

<?php
$conn=odbc_conn ect('FB Employee Sample','SYSDBA ','masterkey');
if (!$conn)
{
exit("Connectio n Failed: " . $conn);
}
$sql="SELECT * FROM EMPLOYEES";
$rs=odbc_exec($ conn,$sql);
if (!$rs)
{
exit("Error in SQL");
}
echo "<table><tr >";
echo "<th>Employ ee Name</th>";
echo "<th>Employ ee ID</th></tr>";
while (odbc_fetch_row ($rs))
{
$empname=odbc_r esult($rs,"Full Name");
$empid=odbc_res ult($rs,"Contac tName");
echo "<tr><td>$empna me</td>";
echo "<td>$empid </td></tr>";
}
odbc_close($con n);
echo "</table>";
?>

</body>
</html>
*************** ************

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
PHP?

TIA,
Dan

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
1377
by: M P | last post by:
What does this mean? I am accessing an ASP page that queries Access Database thru fileDSN. I'm using IIS 5.0 Win2K SP4 Microsoft OLE DB Provider for ODBC Drivers error '80004005' General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x444 Thread 0xfe4 DBC 0x5200024 Jet'.
5
6171
by: Todd Huish | last post by:
I have noticed something disturbing when retrieving datasets over a relatively slow line (multiple T1). I am looking at about 25 seconds to retrieve 500 rows via a php-odbc link. This same select from the cli is for all intents practicaly instantaneous. After much research I discovered that PHP by default uses a dynamic cursor type which can...
14
10119
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought I should give back to the community by posting our findings. Thanks you all for all your help till now by posting problems and their solutions. ...
4
3565
by: Dave | last post by:
Hey guys, I have an ODBC problem that has me stumped. I wrote a VBA script to run in Microsoft Excel that pulls data out of an application using that application's ODBC driver and puts it into Excel. I am trying to translate the same program over to Microsoft Access and I ran into a problem. Access locks up if the data I am querying for is...
8
1887
by: acb | last post by:
Hello, I am a beginner in ASP.NET and C# having programmed in VB (not the .NET flavour) in the past. I am looking for assistance in converting a functional VB.NET aspx page to C#. I am trying to extract data from a database using ODBC. A search on the internet led me to the page at http://forums.asp.net/27667/ShowPost.aspx that contained...
3
8893
by: Giuseppe D'Elia | last post by:
Hi there, I got a problem using an MS Access database through ASP.NET. After updating my system from .NET Framework 1.0 to 1.1, my existing application gives me the following error when opening a connection with the code below:
0
294
by: Mits | last post by:
I am using following connection string to get data from a .csv file using vb.net strConnstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + System.IO.Path.GetDirectoryName(sFileName) + ";" It gives me following error on this line da.Fill(DS, "Test")
12
14458
by: mukeshhtrivedi | last post by:
We have 4 MS Access Databases with few tables on each DB. There are some reports which uses ODBC. When I try to use the report and input date range and click ok I get error "ODBC --call failed" it happens on my computer only. I have just setup Windows XP SP2 with latest updates and MS Office Prof. 2000 and in ODBC I have same dirvers installed...
2
1850
by: Greg Corradini | last post by:
Hello All, A few weeks ago, I wrote two scripts using mx.ODBC on an Access DB. Among other things, both scripts create new tables, perform a query and then populate the tables with data in a dictionary that I've uploaded from elsewhere. These scripts have run hundreds of times in the last few weeks with no problems. But recently they...
4
10065
by: Szymon Dembek | last post by:
Hi Recently I did some DB2 and ODBC coding in Visual FoxPro. I bumped on a problem I cannot resolve. When I issue a delete statement that deletes no rows (no rows qualify for the WHERE conditions), DB2 raises SQL0100W warning with SQLSTATE=02000. The same happens when issuing an insert with select clause (insert into .... select from...
0
7778
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7874
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3798
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1389
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.