I have found the root cause :). The error message 'Unspecified error' is not very helpful though..
Maybe, I have not given enough info to think about the root cause here. anyway, I shall leave the root cause here so that It might be helpful to point out the direction for someone.
The DLL is linked to Perl by using Perl XS. Before calling the DLL function, Perl XS allocated enormous amount of Memory (almost 1.76 GB) for output variables of the function.
Already there is some memory used by the running program. So, the total memory usage is ~ 1.9 GB. When the DLL is trying to open the connection to MS Access database, Msjet40.dll could have been ran out of memory. 'OutOfMemoryException' could have been the appropriate one. But I got 'Unspecified error'.
How did I debug?
(I know , it is funny :)) Initially I was doubtful about the MS Access file. So, I tried to Compact and Repair the MS Access file. Obviously, It didn't work.
Then I have tried to change the OleDbConnection to OdbcConnection. Atleast, this revealed that "System Resource Exceedeed" Exception.
So I started VMMap to analyse the memory usage. There I saw that Enormous amount of memory was allocation in Heap.
Thus located the root cause.
Why there was no problem on Folder "A" perl script?
The folder "A" perl scripts uses less memory before calling the DLL function. So, It does not exceed the memory limit (2 GB) of Windows 32-bit process.