Board index » delphi » ADO connection
Hendrik
Delphi Developer |
Hendrik
Delphi Developer |
ADO connection2003-10-23 06:49:08 PM delphi247 Using D7, ADO & MS SQL 2000. How do I detect if the connection is broken through for example a database shutdown or network fault? Thanks. Hendrik |
Kovalenko Dmitry
Delphi Developer |
2003-10-24 10:05:20 PM
Re:ADO connectionQuoteUsing D7, ADO & MS SQL 2000. |
Brian Hollister
Delphi Developer |
2003-10-24 10:27:41 PM
Re:ADO connection
I'm sorry but I cannot find any documentation on a "Connection Status"
anywhere in ADODB. The closest thing i could find resembling that is the State property of an ADOConnection object. With periodic calls to check that property couldn't one "watch" the database for disconnects and such. "Kovalenko Dmitry" <XXXX@XXXXX.COM>writes Quote>Using D7, ADO & MS SQL 2000. |
Ken
Delphi Developer |
2003-11-15 09:57:04 AM
Re:ADO connection
Hey, guys I am converting a 4year old paradox database program to MS SQL 2000. So far everything going well, I want to trap when the server is disconnected, or lost connection. I can not seem to find any info on how to do it. I am sure its a event in the ADOConnection. Any help would be nice!
Thanks |
darren
Delphi Developer |
2003-11-15 09:08:58 PM
Re:ADO connection
I looked for this too and couldn't find it. I ended up using a timer that
checks the connection periodically. "Ken" <XXXX@XXXXX.COM>writes Quote
it. I am sure its a event in the ADOConnection. Any help would be nice! Quote
|
Donald Hilliard
Delphi Developer |
2003-11-16 06:32:34 AM
Re:ADO connection
Ken, I have used the Connected Property of the ADOConnection the check if the
connection is true. If ADOConnection1.Connected Then Begin // Do Something End Else Begin // Do Something else End; "darren" <XXXX@XXXXX.COM>writes QuoteI looked for this too and couldn't find it. I ended up using a timer that |
ozbear2
Delphi Developer |
2003-11-16 10:36:15 AM
Re:ADO connection
On 14 Nov 2003 18:57:04 -0700, "Ken" <XXXX@XXXXX.COM>writes:
Quote
this may seem like an odd question, but why do you need to know when the connection has gone? By that I mean, what will you do with that information? Your application will find out soon enough if you try to query or post something back to the server. If you user isn't doing anything at the moment (like working in another application while yours is running) with your application then why do they care? If all you are going to do is place the connected/disconnected status on a status bar, for example, I don't see how this benefits anyone. If the user is working with, say, an ADOClientDataSet they can quite happily keep doing whatever they want to do with it until post-back time, at which time you attempt to reconnect (perhaps silently) and report failure then if unsuccessful. Just askin', Oz |
Ray Marron
Delphi Developer |
2004-04-07 11:53:47 PM
Re:ADO connection
"Christopher Davis" <XXXX@XXXXX.COM>writes
Quote
anyway. If you need to write to the file, I don't think it would be practical. However, if you have some personal webspace provided by your ISP, you can try it out if you're still curious. I have no idea what the connection string would look like. I would try 'FILE NAME=ftpsite.udl' and use a UDL file - easier to mess with on the fly. Good luck! -- Ray Marron |
Christopher Davis
Delphi Developer |
2004-04-08 12:40:59 AM
Re:ADO connection
Can you use an ADO Connection to connect to an access database on an FTP site? If so, how should the connection string be formatted?
|
Sam G.
Delphi Developer |
2004-07-19 01:05:09 PM
Re:ADO connection
Hello,
I would like to move away from BDE to ADO. Just a few questions. 1. Do I need to create an OBDC data souce and is this recomended. 2. In building the connection string for the adoconnection, what is the best provider if I want to connect to MS SQL, 3, I assume that adoconnection replaces my TDatabase component. Thanks in advance. Sam |
Yannis
Delphi Developer |
2004-07-19 02:06:25 PM
Re:ADO connection
"Sam G." <XXXX@XXXXX.COM>wrote in
QuoteHello, Quote2. In building the connection string for the adoconnection, what is Quote3, I assume that adoconnection replaces my TDatabase component. yes it is a replacement. Regards Yannis. |
John McGill
Delphi Developer |
2004-09-14 08:13:45 PM
Re:ADO connection
I am using SQL Server 2000 and Delphi 5. If as a result of an event I run a
query on the database and for some reason the DB Server is down, can somebody show me how I can recover from this so that the next time the query is run and the DB Server is back, it runs without any problem. I continuously get Connection Failure even when the DB Server is back. I have tried to reset many different things in ADOConnection but so far without any luck. Thanks, John |
John McGill
Delphi Developer |
2004-09-15 03:30:56 PM
Re:ADO connection
No takers. Does this mean nobody ever does this or it is not possible. I
can't find any example of this on the internet. John "John McGill" <XXXX@XXXXX.COM>writes QuoteI am using SQL Server 2000 and Delphi 5. If as a result of an event I run |
Ivan Krastev
Delphi Developer |
2008-03-15 05:25:54 AM
Re:ADO connection
Hi,
I'm trying to connect to acces database from delphi. I tried different examples, but each time when I connect appear ado login dialog and prompt me for a user and password. After pressing OK without any input the connection is created successfull. How is possible to skip this dialog. I tried with different DB without success - each time appear this dialog. Also I have not installed access on my machine. Maybe this is the reason? Thanks in advance! best regards Ivan Krastev ---------------------------------------------------------------------------- var MyDBConnection : TADOConnection; begin // create the connection object MyDBConnection := TADOConnection.Create(Application); try // set the connectionstring MyDBConnection.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;' + 'Data Source=' + PrgDir + 'pcbis_sort.mdb;' + 'Persist Security Info=False'; // open the connection MyDBConnection.Open; // do whatever you want with this connection // (...) // close the connection MyDBConnection.Close; finally // in all cases, free the object MyDBConnection.Free; end; end; |
Pieter Zijlstra
Delphi Developer |
2008-03-15 05:41:52 AM
Re:ADO connection
Ivan Krastev writes:
QuoteI'm trying to connect to acces database from delphi. QuoteAlso I have not installed access on my machine. Maybe this is the Pieter |