473,698 Members | 2,152 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 4267
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
6185
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 be quite a bit slower than a forward only cursor. BTW I have been searching forward only/read...
14
10131
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. ~Abhijit
4
3570
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 not present in the database. To retrieve data from the database of the application, my Excel...
8
1895
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 a functional example in VB.NET. This worked on my computer. Hereunder is a snippet
3
8896
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
14467
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 as other users who are able to access reports without any problem. Can anybody tell me what...
2
1856
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 continue to bail on the mycursor.execute('An SQL Statement') after the table has been created. I get the...
4
10078
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 ...) when no rows are fetched by the select clause.
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8870
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6524
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4370
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.