Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What if a connection is lost?

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
I have a connection from my server to my as/400. Sometimes in the middle of writing a database file, the connection is lost.
How do I make it so the as/400 does not process the 1/2 data? How do I tell my server that all of the data did not move over?

Up until now we have been going thru it by hand, because it happens so less often, but I can learn something from this. P-)
 
Can you catch the exception?

Daren J. Lahey
Just another computer guy...
FAQ183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
Support your forums TODAY!
 
What do you mean? Currently I am using VB6 for my application. Soon I will be moving it to .NET, I hope.
 
well, with VB.NET and ASP.NET (this forum) you can catch the exception thrown by your connection object.

begin try
conn.Open()
'TO DO
end try
begin catch e as Exception
'TO DO catch the error if equal to ADODB connection error
end catch
begin finally
conn.Close()
end finally

(or something similar, I'm more a C# user)

but in your case I would suggest you connect again to the db and verify taht all the data is there with a simple select statement. Could this do for you?

Daren J. Lahey
Just another computer guy...
FAQ183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
Support your forums TODAY!
 
I think this might work ok. Will let you know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top