Catching ADO Connection error

Hi all,

is it possible, to catch an ADO connection exception within try..except?



If an existing ADO connection is lost due to server shutdown, a message box pops up:

*[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist...*

and the normal program flow is interrupted.

+try+
 +...+
 +ADOConnection1.Open;+
+...+

+except+
+..end;+

does not work.

thx for any help
Heinrich
0
Heinrich
11/14/2008 12:49:25 PM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

1 Replies
1487 Views

Similar Articles

[PageSpeed] 35

Heinrich Braun skrev:
> Hi all,
> 
> is it possible, to catch an ADO connection exception within try..except?
> 
> 
> 
> If an existing ADO connection is lost due to server shutdown, a message box pops up:
> 
> *[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist...*
> 
> and the normal program flow is interrupted.
> 
> +try+
>  +...+
>  +ADOConnection1.Open;+
> +...+
> 
> +except+
> +..end;+
> 
> does not work.
> 
> thx for any help
> Heinrich

Your code shows a message when you run from the IDE with the debugger.
Try to start the application without the debugger and you won't see the 
message when you do ADOConnection1.Open.

/Micke
0
Mikael
11/14/2008 2:48:29 PM
Reply:

Similar Artilces:

ADO Connection Executes a Procedure But does not catch the error returned
Hi , I have a Problem .ADO Connection Executes a Procedure But does not catch the error returned.I get no errors in the error collection of Connection object in ADO when i connect to sybase 11. M code is as follows .I don't get any value in error_item variable.Please help Public Function Login(ByVal strUsrNm As String, ByVal strUsrPwd As String) As Boolean Login = False Dim strAppName As String Dim strIpAddress As String Dim strHostName As String Dim strUserID As String Dim Coun As Integer 'Set rs = Nothing On Error GoTo ErrLogin Call OpenConnecti...

Convert Delphi 5 ADO App to Delphi 2007 ADO.NET
I have an appliction tha that is writen in Delphi 5 with ADOConnetion, ADOTable, and ADOQuery components. I need to upgrade to Delphi 2007 and use ADO.NET. I have the program building in with Delphi 2007. Is there anything I need to do to convert the ADO to ADO.NET? > I need to upgrade to Delphi 2007 and use ADO.NET. Why ? -- With best regards, Dmitry Arefiev AnyDAC (www.anydac.com) - Oracle, MS SQL Server, IBM DB2, MySQL, Firebird, Interbase, PostgreSQL, Sybase ASA, SQLite, MS Access, DBX, ODBC, InMem - universal high-speed native data access engine Reasons for ...

ADO Connection Errors
I have a multi-threaded application that hits both a local database and a central one (over a low bandwidth connection). The same code executes against both, depending whether the client being processed is a local or central client. I open database connections, perform my operations, and close them. I am getting connection related errors such as: a) 'Cannot create a new connection because in manual or distributed transaction mode' when trying to establish a connection. b) 'Operation cannot be performed while executing Asynchronously'. This one appears spora...

Delphi 2010 + TIBDatabase + connection error (how to catch error) [Edit]
Hi All Could someone help me in this case: {code} Try DataBase.Connect:=True; Except on >databaseconnectionerror< do ShowMessage('DataBase connection faild); end; {code} I do not know, how to catch (handling) IB errors in my Delphi application. Thank You very much in advance Best Regards Jacek Edited by: Jacek Fągowski on Aug 14, 2012 9:04 AM Jacek Fągowski wrote: > Hi All > > Could someone help me in this case: > {code} > Try > DataBase.Connect:=True; > Except > on >databaseconnectionerror< do > ShowMes...

DBD::ADO connect error...
------=____1092774311504_XhQXFImQ1N Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Howdy, I have a script (attached) that creates an Access 2K database, connects to it, creates a table, and pops some data into it. It all works, no problem. However, I'm getting the following messages on the console (CMD prompt): Use of uninitialized value in subroutine entry at C:/Perl/site/lib/DBI.pm line 595. DBD::ADO::dr connect warning: at C:/Perl/site/lib/DBI.pm line 595. I'd like to know how to get rid of the messages... Do I need an error...

datetime trouble in ADO Microsoft ADO .NET Connection
Hi, All! MS SQL 200 PB 10.2.1 build 9557 In PB DB Painter: select dateevent from AuditInternal where id_event = 201865; Result: ADO Microsoft ADO .NET Connection: 214:35:45:633 OLE Microsoft OLE DB Connection: 01.03.2006 12:35:45:633 It has begun in 9537 In 9557 same. In 9004 all this it was good thanks, Alexey ...

ASA7 ADO & Delphi ADO ?? Anyone is using it?
Any comments? Is it working? Any Problems? Thanks Hi, PR <noemail@no.com> schrieb in im Newsbeitrag: BoTThJaq$GA.89@forums.sybase.com... > Any comments? Is it working? Any Problems? I tried to connect to ASA7 via the new OLE DB - Provider and ADOExpress from Delphi 5.01. No chance. Only the error message 'Invalid Enum Value'. About the new provider I haven't heard anything good until now... Regards Frank Frank, I've experienced the same problem with the ASA 7 OLEDB Provider. I'm not sure if this is a bug in the AsaProvider or Delp...

ADO.NET connection error
All right here's my problem: I have several aspx pages that work together using a Access database. They work fine for awhile and then all of the sudden it hits an error opening the database. I should mention that this problem does not occur when I'm just using the web matrix server instead of IIS. It doesn't make any sense to me. I was hoping someone else could help, Any takers? O.K. I was wrong it does occur with the matrix server. It just takes longer to happen. Heres a thought? Does Access have a max number of connection? How are you creating and storing the connectio...

ADO to ADO.NET
I'm an ASP programmer (VBScript) moving on to ASP.NET. So far I'm using:Microsoft Visual Studio 2003ASP.NET with C#I'm working on converting my code over to C#, from VBScript. Now, here is my code in VBScript (modified to better understand it, this is a edited ugly version):Function ExecuteSQL(sqlStatement)    ConnDriver = "Provider=SQLOLEDB; Data Source = " & dbIP & "; Initial Catalog = " & dbName & "; User Id = " & dbUser & "; Password=" & dbPassword     Set connTemp = Server.CreateObject("ADODB.Connection")    c...

ADO not ADO.NET
Hi, I have to connect to a db using adodb (which i select from the references). I have to retrieve the car models from the database and bind them to a listbox. I am not sure how to proceed and I can't find any articles on ADO with .net and data binding. Here is the code that i tried but it only retrieves the car model for the specified id. If I delete the id it doesn't work. Also it writes the car model in the listbox vertically such as: B M W CODE: Imports System.Data Imports ADODB Imports System.Data.OleDb Public Class listboxADO Inherits System.Web.UI...

Help with ADO connectivity in Delphi XE
The company I work for has finally started migrating applications from Delphi 5 and 7 to Delphi XE and XE2. But, I am having a problem with a TADOConnection. A simple application built in D5 to connect to a MS SQL database works. But the same code compiled in Delphi XE will not connect. When the user's role changes from User to Power User, they can connect to the database in the app compiled in XE. The workstation that the user is running from is Windows XP. The SQL Server version is 2005. MDAC version 2.8 Unfortunately, we have been unable to simulate their environment, an...

Delphi XE + TClientDataSet + ADO error
Hi, I have the error reported in this QC article: http://qc.embarcadero.com/wc/qcmain.aspx?d=88928 Anybody knows how to fix it ? Regards ...

Connection String for ADO Database in delphi prism
Hi, I want to connect to a database with ADO and aspx. from VB code what is the equivalent in delphi prism ? .... Dim MyReader as sqldatareader Dim MyConnection as sqlconnection = new sqlconnection() myConnection.connectionstring = configurationmanager.connectionstrings("DSN_MYDB").connectionstring Dim mycommand as sqlcommand = new sqlcommand() mycommand.commandtext="select * from mytable" mycommand.commandtype = commandtype.text mycommand.connection = myconnection mycommand.connection.open() Myreader=mycommand.executereader(commandbehavior.closeconnec...

A problem about connecting ASA by ADO component of Delphi?
Is there anyone to try to use ADO component of Delphi to connect ASA? I fail to do it. I manipulate database by TDataSource,TADOQuery,TConnection components of Delphi, and set up connection with ASA guide. When running the program, the connection is set up successfully. But a EoleException is thrown once I make a query using TADOQuery. System prompt "unknown error". Who knows what happened? Is it a compatible problem between ASA driver(ASAProv) and ADO component of Delphi? (All are ok when connecting ASA by BDE components). Is there anyone to try this?? ...

Web resources about - Catching ADO Connection error - embarcadero.delphi.ado

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
High-quality data, if not used properly, can still lead marketers to make bad decisions. Consider these common ways that numbers are used to ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

CareerSonar Turns Facebook Friends Into Job Connections
Looking for a job ? Among your Facebook friends lies the potential for employment. CareerSonar , a new service, brings together a person’s connections ...

Half of data connections by top 500 Android apps are 'covert' with no effect on user experience
Researchers at the Massachusetts Institute of Technology have discovered that half of the communications connections established by the top free ...

The Direct Connection
... And the people reading my words respond back to me with words of their own. The technology that allows this is powerful but this direct connection ...

Is There A Connection Between Patrick Murphy's Over-The-Top Corruption And His Campaign Emails?
The DCCC may be stupid or even very stupid (as well as utterly incompetent) but their e-mail strategy is very well-planned out. Their overarching ...

Cross-cultural Connections and Exchange: international study is more important than ever
... And, as a minority of ill-intentioned individuals and groups do their best to create divides, we need citizens equipped to create connections ...

Connection And Collaboration In the Cloud
Forbes technology editor Bruce Upbin deconstructs the cloud and maps its potential to your life.

Mali arrests 2 in connection with deadly hotel attack
Mali arrests 2 in connection with deadly hotel attack

Resources last updated: 12/3/2015 1:07:10 PM