Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Handling Database connection error

Hi All

I have a trouble here to handle database connection error.
Basically I have a program which runs 24 hours and 7 days a week
continuously. In this program I connect to the database and retrieve the data
after every 15 minutes. But sometime there is database connection error and
which stops the program forever. Because it open the database window and ask
to select the datasource, until someone click OK, program doesnt start. I
have used error handling function but it doesnt stop to open that database
window.

Here is the Code:

Option Explicit

Sub Macro2()

Code

On Error GoTo Stoprogram
With Selection.QueryTable
.Connection = ODBC;DSN=ABCD;UID=user;PWD=password;SERVER=xyz;"
On Error GoTo Stoprogram
.Refresh BackgroundQuery:=False
End With

Code

Stoprogram:
End Sub


Your help would be greatly appreciated.
Thanks
Harish


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS-Excel and Complex Database Handling? Mike Excel Discussion (Misc queries) 2 May 18th 06 08:14 PM
Database Connection Phil Excel Programming 1 September 30th 05 12:25 PM
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM
Error Handling when database not available Tod Excel Programming 1 August 16th 04 04:55 PM
DataBase Connection willie[_2_] Excel Programming 0 January 27th 04 10:06 PM


All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"