How to restore connection after line break (win-xp))

Hello all,
A c/s application built with Delphi 6 + Ado+Db2-UDB. 
When a line break occurs there is an error message 'Link failure...' issued by the DataSet. After the line comes back, errors continue until restart of the application.
I try to close and open the TAdoConnection but it seems like nothing happend.

Please advise how to restore connection without application restart.

Best regards
I. Nemlich

Edited by: Israel Nemlich on Nov 6, 2008 10:59 PM
0
Israel
11/7/2008 7:00:05 AM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

8 Replies
954 Views

Similar Articles

[PageSpeed] 18

Israel Nemlich wrote:

> Please advise how to restore connection without application restart.

1. Create a new connection
2. Loop through the old connection's datasets property.
3. Set each dataset's connection property to the new connection.
4. free the old connection
5. Store the new connection in the old connection variable.

-- 
Iman
0
Iman
11/6/2008 11:15:06 PM
Iman, thanks.

Is it possible to get a sample how to do it.

 
> {quote:title=Iman Crawford wrote:}{quote}
> Israel Nemlich wrote:
> 
> > Please advise how to restore connection without application restart.
> 
> 1. Create a new connection
> 2. Loop through the old connection's datasets property.
> 3. Set each dataset's connection property to the new connection.
> 4. free the old connection
> 5. Store the new connection in the old connection variable.
> 
> -- 
> Iman
0
Israel
11/7/2008 12:44:14 PM
Israel Nemlich wrote:

> It looks a very long process, Is this the only solution.
> What is wrong with the TAdoConnection component that we can not
> handle specifically  

It is a tedious process.  You have to also remember to close all the
existing datasets before setting the new connection and then open them
aagin.

Not sure why, but when TAdoConnection loses connection to the DB you
can't just close and open it.

-- 
Iman
0
Iman
11/7/2008 2:21:42 PM
Hello Israel

You can try to use AnyDAC 2.0:
- it has DB2 driver;
- it offers automatic broken connection recovery.

-- 
With best regards,
Dmitry Arefiev
AnyDAC Team

RemObjects Software
The Infrastructure Company
http://www.remobjects.com
0
Dmitry
11/11/2008 1:28:19 AM
Dmitry,

Does AnyDAC also allow for automatic failover of my SQL Server 2005 servers? 
I have a database that is mirrored  to a second SQL Server 2005 server and a 
third Witness Server in my farm.  When the primary SQL server fails or needs 
to be taken down, the backup server becomes primary.    I currently use ADO 
with the Native SQLNCLI driver and my app fails until I restart it.  It then 
finds the backup server because the SQLNCLI driver has the parameter to 
specify the backup.

But it is not automatic, and that is what I'm looking for.

Thanks

John

"Dmitry Arefiev" <darefiev@da-soft.com> wrote in message 
news:41846@forums.codegear.com...
> Hello Israel
>
> You can try to use AnyDAC 2.0:
> - it has DB2 driver;
> - it offers automatic broken connection recovery.
>
> -- 
> With best regards,
> Dmitry Arefiev
> AnyDAC Team
>
> RemObjects Software
> The Infrastructure Company
> http://www.remobjects.com
0
John
11/12/2008 10:44:35 PM
Hello John

> Does AnyDAC also allow for automatic failover of my SQL Server 2005 
> servers?

First at all, I never have tested SQL Server 2005 automatic failover.
But as I see from documentation, it must be supported. There are
two key moments:

1) must be specified Failover_Partner connection parameter.
In AnyDAC it may be specified as:
ODBCAdvanced=Failover_Partner=partner_B

2) when a principal server fails, application must be reconnected.
And if Failover_Partner is specified, then it will connect to mirror
server. AnyDAC offers automatic reconnection in case of
connection failure. To turn it on use:
ADConnection1.ResourceOptions.AutoReconnect := True;

Also, AnyDAC has trial edition, so you can try all that in your
environment.

-- 
With best regards,
Dmitry Arefiev
AnyDAC Team

RemObjects Software
The Infrastructure Company
http://www.remobjects.com
0
Dmitry
11/13/2008 5:28:44 AM
PS: All, what I wrote is applied to AnyDAC 2.0 only.

-- 
With best regards,
Dmitry Arefiev
AnyDAC Team

RemObjects Software
The Infrastructure Company
http://www.remobjects.com
0
Dmitry
11/13/2008 5:51:14 AM
Dmitry,

I prefer to find a solution while using the ordinary Delphi Ado components.

I tried to use: CREATE and FREE tAdoConnect and tAdoDataSet, it looks the right direction but it arises some new problems that need to be solved.

Best regards
I. Nemlich   




> {quote:title=Dmitry Arefiev wrote:}{quote}
> PS: All, what I wrote is applied to AnyDAC 2.0 only.
> 
> -- 
> With best regards,
> Dmitry Arefiev
> AnyDAC Team
> 
> RemObjects Software
> The Infrastructure Company
> http://www.remobjects.com
0
Israel
11/13/2008 8:48:16 AM
Reply:

Similar Artilces:

Line break or not to line break
Gurus, thx in advance. I'm a sysadmin gone mad (NEWB Coder) What I am trying to do will be simple sor one of you guys. I have the book titled Build Your Own ASP.net 2.0 WebSite using c# & VB from which I am trying to learn .net / VWD . The snippet of code that follows will help me explain my issue. <script runat="server" language="VB"> Sub Click(ByVal s As Object, ByVal e As EventArgs) Dim i As Integer feedbackLabel.Text = "Your name is: " & name.Value & "<br />" feedbackLabel.Text += "Your email is: " &...

win xp restore
I am wondering......... WIN XP Pro or Home I think it applies to both: If you turn off system restore, it says you will loose all restore point that have been created in the past. Sometimes you have to turn off system restore to get rid of nasty bugs that hide there. So what I am wondering is there just one file associated with each system restore point? I am assuming it is a reg back up. Correct? So can I go in and copy the that file that system restore created, burn it to a disk and save it off the machine, then uncheck "system restore" (and consequently loose ...

connectivity issues with win XP
Using NW SB 6.0 and win 2K and Win XP, I can not gain GUI access to the the volumes with the XP machines. Win 2K works fine. XP is using SP2, though I am not sure if this is related. I have disabled the firewall to no avail. I can access the volumes with the DOS prompt. Using windows explorer, I can browse the network, see the volumes, but get message "volume not accessible .. may not have permission ... the filename, directory name, or vol syntax label is incorrect." I am using client 4.90. Any suggestions would be appreciated. Thank you in advance. Two things ...

System Restore In WIN XP
Any Thoughts? I went to System Restore, wanted to check the "System Restore Settings", but when I click on this nothing happens, before, I could click here and change disc space settings etc, now ?????? Any Ideas why I can't get this info now? This is a new WIN XP Home ver on a DELL Computer, not upgraded from Win 98 etc. Dave First think I would do is go get all the patches and updates. They will all be in service pack1. -- Firewire "Dave" <sonicjoetoo@hotmail.com> wrote in message news:as8nr5$2ud3$1@news.grc.com... > Any Thoughts? ...

DBD::ADO line breaks
I am wondering if someone could help with insertion of line breaks into an Access Memo (clob) field. Is there a DBD::ADO option which allows \r\n to be seen in Access as line break? Currently "foo\r\nbar" looks like "foo[][]bar", where [] is a sqare box. Thank you. Alec Brecher E Research Resources office 802 253-8908 www.eresearchresources.com Hi alec, I use quote(); $abc = "abc'xyz'123'other\nstuff\r789"; $sql = "insert into tblStuff (clob) values ('".$dbh->quote($abc),"') "; ....s...

update
I am wondering......... WIN XP Pro or Home I think it applies to both: If you turn off system restore, it says you will loose all restore point that have been created in the past. Sometimes you have to turn off system restore to get rid of nasty bugs that hide there. So what I am wondering is there just one file associated with each system restore point? I am assuming it is a reg back up. Correct? So can I go in and copy the that file that system restore created, burn it to a disk and save it off the machine, then uncheck "system restore" (and consequently loose all re...

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 ...

XP network connections 1394 connection connected! huh?
Hi, XP Network Connections 1394 connection connected. There is no device plugged into my firewire port. Why does it show 1394 connection connected in Network connections? Maybe I just never noticed before.. While ducking under cover and reloading, I thought I heard code_wrong say: > Hi, > XP Network Connections 1394 connection connected. > There is no device plugged into my firewire port. > Why does it show 1394 connection connected in Network connections? > > Maybe I just never noticed before.. Same here, but like you said, nothing is plugged in so I...

Connecting to Win XP network printer
Still got a problem connecting network printer. The printer is connected to the PC through USB001 port as default plug-and-play printer of that machine. The printer (HP LaserJet M1005 MFP - shared name: HP) is shared and works fine if I attached it from other win based platform. I can see the partitions on the PC through Samba but I can't see or connect the printer. I got the following message: 'There was a problem. You specified an individual queue name on the printer server, the print server does not accept print jobs, or the queue on the print server does not accept pr...

win xp random restore points
Hello gang, I have noticed that XP Pro (in my experience anyway) occasionally does a system restore all on it's own... My most recent 'incident' happened when I ghosted my 98Se partition to a new drive...upon reboot...XP had reverted to an earlier point....It did do a boot diskscan without my prompting and found no errors...It's not _Really_ a monstrous deal since most of the time it's just custom settings and uninstalled apps that come back....but, anybody else have this happen? Ike in Lawton. ...

Win XP SP2 breaks DNN
I just installed SP2, and it caused DNN to not work anymore. I get the error: ERROR: Could not connect to database. SQL Server does not exist or access denied. My SQL Server and IIS are on the same machine. Does anyone know if I need to do anything with SP2 to make the database visible to IIS?? Any ideas? Thanks.Nate Davis if there is a firewall turned on .. or something like that.. it could be the problem... just a guess... I guess I posted too soon. I just fixed the problem by changing localhost to (local) in the connection string in web.config. See this post for more...

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...

Replacing \n line breaks with HTML br line breaks in Gridview; what is the recommended practice.
Hello,It has been awhile since I have manipulated data in a Gridview. I am binding an collection to a Gridview and one of the values contains non-html line breaks (\n). I would like to convert these to html line breaks (<br />). The code below works fine.protected void gridHistory_RowDataBound(object sender, GridViewRowEventArgs e) { GridViewRow row = e.Row; if (e.Row.RowType == DataControlRowType.DataRow) { row.Cells[0].Text = row.Cells[0].Text.Replace("\n", "<br />"); } }Is there an "easier"/"better" way of doing it?Thanks.To...

Merant ADO connection problem with Windows XP
Hi, I am not facing any problem when I try to connect Sybase db from my VB application using MERANT DataDirect Connect ADO 2.5 in Windows 2000. When I try to run the same application from Windows XP using same driver, I am getting unspecified error(-2147467259) while connecting Sybase db. Connection will be established after throwing the error. Can any help me regarding this?? If you are using the MERANT provider please send your request to DataDirect Technologies, as well. Also, there are several releases of the Provider after 2.50 - you are probably running into some M...

Web resources about - How to restore connection after line break (win-xp)) - 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 ...

Don’t Let Great Content Fall on Deaf Ears: Know your Connection Strategy
... via employee newsletter when it should have come through small-group manager meetings All of these and more are the result of a faulty connection ...

Be Goofy, Smile At Your Baby: Protection Begins with Connection, Pediatrician Says
VideoPart 3 of a series Andrew Garner wears silly ties and finds it easy to make a goofy face. These are valuable tools for charming the babies ...

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

Get ready for live-streamed extreme sports: Seattle startup Sioeye adds 4G connection to action cam
The history of people doing crazy stunts on camera is full of notable achievements. Motorcycle daredevil Evel Knievel jumped over whatever he ...

Resources last updated: 11/27/2015 8:39:32 PM