Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Delphi4PHP NNTP Newsgroups > embarcadero.public.delphiphp.database
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

embarcadero.public.delphiphp.database This group is for all discussion about databases and using them with Delphi for PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22nd January 2010, 21:25
D4PHP User
 
Join Date: Jun 2009
Posts: 13
endlessloop is on a distinguished road
Default Check if Database component is connected

Hello, I have a problem here (Suppose $Unidad2 is a DataModule):

try
{
$Unidad2->db->Open();
echo "good";
}
catch(EDatabaseError $e)
{
echo "bad";
}

it works fine, but it shows me the warning.
And if i supress the warnings with the @ operator, like:

try
{
$Unidad2->db->Open();
echo "good";
}
catch(EDatabaseError $e)
{
echo "bad";
}

the exception is not raised, the connection is not made, and the Connected property stills returns TRUE.

Briefing: i need how to not show the cant-connect-warnings, but at the same time allow exceptions to catch if the database could connect or not.

The db property, in this case, is a "Database" component.

Last edited by endlessloop; 22nd January 2010 at 21:51.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 22nd January 2010, 22:52
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,271
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Try just using standard php db connections and not the adodb stuff and what you want to do should work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 22:45.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use