Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm using a function to retrieve data from SQL Server (2000) with Excel 2003, the connection string I'm using is the following... On Error Resume Next Set Connect = CreateObject("ADODB.Connection") OdbcDSN = "Driver={SQL Server};SERVER=hostname\name;UID=sa;DATABASE=mydb" Connect.Open OdbcDSN '--------------- The Excel just closes here! If Connect.Errors.Count < 0 Then For Each objError In Connect.Errors If objError.NativeError < 5701 And objError.NativeError < 5703 Then ' Ignore the success warnings Connect.Close GoTo Continue End If Next End If The problem is that I want to handle if the user can't reach the SQL Server (for any reason) so the function will continue executing the rest of the tasks but, when the function tries to open the connection, excel simply closes, with no error, no warnings... nothing at all. ~Luis Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - MS sqlserver 2000 connection | Excel Discussion (Misc queries) | |||
Macro Suddenly Fails | Excel Discussion (Misc queries) | |||
ADO Connection to ORACLE 9.2 through EXCEL fails | Excel Programming | |||
DTS: SQLServer to Excel in unattended server environment | Excel Programming | |||
Excel Front End , SqlServer Backend in the web | Excel Programming |