Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a OLEDB CONNECT in a scheduled reload that sometimes fails. Is there a way of handling that failure?
I want to be able to use another OLEDB CONNECT if the first one fails.
The only way I can handle failure at the moment is in the QMC job scheduler.
Hi Ashar,
The second ODBC will be used if the first one fails. !
--------------------------------------------------------------------------
set ErrorMode=0;
OLEDB CONNECT32 TO [Provider=MSDASQL.1;Persist Security Info=False;Data Source=MyTest;Extended Properties="DSN=MyTest;DBQ=C:\Temp\Database1.accdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"];
let ErrorNum = num(ScriptError);
Trace ScriptError: $(ErrorNum);
IF ErrorNum > 0 Then
OLEDB CONNECT32 TO [Provider=MSDASQL.1;Persist Security Info=False;Data Source=MyTest2;Extended Properties="DSN=MyTest2;DBQ=C:\Temp\Database2.accdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"];
ENDIF
[Temp]:
Load
Client
, ID
;
SQL SELECT
Client
, ID
FROM TClient;
--------------------------------------------------------------------------
Best Regards,
Cyrus
Hi Ashar,
Inside QMC go to System->Setup->Select Distribution Services ->Alert E-mail and here mention your email Id. This will help you for getting automatic alert whenever any task got failed.
Thanks,
AS
Hi,
If i was you i would find out what the cause of the failure is. In my mind the following could be the issue:
1. Different connection name: Make sure that the connection name on the server and the development environment is the same.
2. User credentials: Make sure that the user credentials being used on the development machine are valid on the server too.
This could help you eliminate the failure in the first place.
Regards
Rahul
Thanks but I got alert emails set up already. I am looking for some way to automatically connect to the second database, if the first one fails.
Its a cluster with 2 IP addresses. Sometimes the main server goes down and the OLEDB CONNECT fails.When this happens, I need to connect to the second server.
Hi Ashar,
The second ODBC will be used if the first one fails. !
--------------------------------------------------------------------------
set ErrorMode=0;
OLEDB CONNECT32 TO [Provider=MSDASQL.1;Persist Security Info=False;Data Source=MyTest;Extended Properties="DSN=MyTest;DBQ=C:\Temp\Database1.accdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"];
let ErrorNum = num(ScriptError);
Trace ScriptError: $(ErrorNum);
IF ErrorNum > 0 Then
OLEDB CONNECT32 TO [Provider=MSDASQL.1;Persist Security Info=False;Data Source=MyTest2;Extended Properties="DSN=MyTest2;DBQ=C:\Temp\Database2.accdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"];
ENDIF
[Temp]:
Load
Client
, ID
;
SQL SELECT
Client
, ID
FROM TClient;
--------------------------------------------------------------------------
Best Regards,
Cyrus
Thanks Cyrus! This is what I was looking for
You are welcome!