strServer = "MYSERVER" strNetType = "Default" strDatabase = "Navision 4" strUsername = "sa" strPWD = "mysapassword" Set CFRONT = CreateObject("cfront.cfrontctrl.1") CFRONT.StopOnAllExceptions = True CFRONT.HideError = False 'CFRONT.SetNavisionPath "C:\Program Files\Microsoft Business Solutions-Navision 4.0\SDK\CFRONT" CFRONT.ReleaseAllObjects CFRONT.ConnectServerAndOpenDatabase "NDBCS", strServer, strNetType, strDatabase, 10000, False, False, strUsername, strPWDWhether I do or don't call SetNavisionPath makes no difference.
If i remove the ReleaseAllObjects call the VBScript engine simply crashes.C/FRONT Fatal Error: CFRONT.DLL or CFRONTSQL.DLL is not loaded. Use ConnectServerandOpenDatabase first or check the parameters. You might have the wrong path in SetNavisionPath call.
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Did you tried to run the example from the SDK? I think I had same problem and the example was not working for me too...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I did also try the sample code in CFRONT.xls but this also fails on the same line of code "ConnectServerAndOpenDatabase" - at least it's consistent!
I have also recieved an "Error 2 in Module 1" from some of the error handlers, which doesn't actually mean anything to me, but according to this file http://www.geocities.com/navision_attain/downloads/Errors_List.xls it means Err_OS_FileNotFound - but I don't know what file is not found.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Sample.xls and sample.exe.
What i do:
- copy all cfront libraries to some test folder
- copy license to the same folder
- copy client files required by Cfront to the same folder.
- run sample.exe -p"[path to current folder]".
Sample must connect to db and start testing it. It doesn't matter that later comes error from db - connection was established so cfront works.
sample.xls requires more work to work:) Usually it requires Cfront install, but you can make reference from VBA designer to cfront dll and add setnavisionpath() statement before connecserver.... Usually it works.
There were many changes in CFRONT in 4.0: it becomes .net (reference must show to microsoft....cfront.dll); has changed path usage and there were many errors fixed. So if it isn't new error then everything must work.
Regards
I'm now going to report this to Microsoft.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
So problems are somewhere else.
I got the same problem on a Windows Server 2003 R2 with SP 2. Did anyone find a solution for the behavior of CFRONT.
Best regards,
Guido