MSSQL and Multiple APP Project

Hi Greg,

I guess it could be the kind of login you use that gives the problems.
I had similar problems with Wndows Authentication in multi-dll app, it just freezed after the Connect button. After i changed to user and password login, same multi-dll app worked fine.

Just try it.

Created a problem report - 43044

After installing 11013505, I am unable to connect multi app solutions to MS SQL databases. The solution locks on the first OPEN(MySqlTable). Single app (exe) solutions connect without trouble.

Reverting to version 11013401 and rebuilding resolves the problem. This was confirmed by Geoff Thomson at CapeSoft.

Geoff was the one who actually identified this and so he deserves full credit.

Thanks to all who have offered help with this.

Greg you say you can reproduce this with a small multi-dll solution.
Could you post that example here and (more importantly) on the PTSS site please. (2.7 MB)

This is the multi-app created by Geoff at CapeSoft. It fails to connect to MS SQL on his system and both my development machine and production environment.

Hi Greg

Seems to be the same issue I reported in #43043 on May 26. is a sample I sent to Geoff to confirm the problem, it uses Multiproj.

In #43043 I attached, reproducing the issue without Multiproj.

Regards (324.1 KB)

Hi Carlos,

I tried your example and it failed in both Build 13505 and 13401

I guess when most people talk about the ‘Program Setup’ embed point they mean the embed in the EXE that comes almost immediately after the CODE statement.

The ‘Program Setup’ that yourself and Greg are talking about is in the ‘Data DLL’ and is actually part of the DLLInitializer.Construct PROCEDURE

I guess you’re wanting it there for Multi-Proj and/or FM3 reasons

If I move that embed code from the Data DLL into the EXE in the ‘Program Setup’ embed point (and add Customer to the File Schematic) then it all works.

Hi Greg,
Have you seen PTSS 43044 has been closed - basically saying that the method of using DLL initialisation embeds to open SQL files is problematic, and code should be moved into the EXE

I think it’s important to remember that there are 2 dll initialization embeds.
Program Setup embeds are in the DLLInitializer.Construct method. This happens very earlier in the program loading. This is the embed point that Carlos’ example uses.
There is also the embed point DLL Initialization. Which sounds similar but this is actually a procedure that is exported from your DLL and the EXE calls during it’s startup code. This is quite a bit later than when a Constructor gets called.
This is the embed point I use to first connect to the database.

That’s interesting Rick
I tried with the DLLTutor example that Carlos posted here.
Fails when using ‘Program Setup’ in the data DLL
Works when using ‘DLL Initialization’ - ‘Initializing other ABC Clarion DLL’ - which is the last one of 4 ‘DLL Initialization’ embed points.

So maybe CapeSoft should move their FM3 and MultiProj embeds into this later embed?

Thanks Rick and Graham. I’ve shared this with CapeSoft.

Softvelocity uses #AT(%ProgramSetup) in both memtable.tpl and dynadrv.tpl to load cached tables.

Even if Capesoft moves the code to another embed (like %AfterCategoryDLLInitCode), SV will have to move their data loading code in those templates too. Or fix the MSSQL connection problem in 13505.