Test application crashing in cfrontsql.dll
hav
Member Posts: 299
Hi,
I have written a test applicaiton using C++ to connect to NAV database and update some records.
I am using NAV 2009 W1 R2 however i also have NAV 5.0 W1 installed on the same machine.
My NAV database resides on SQL Server 2008 R2.
My test application code is as below:-
When i run the above application it crashes in cfrontsql.dll at the line where GetDatabaseName() function is called.
I have converted libload.c to libload.cpp and have compiled it successfully. The cfront.ocx and cfrontsql.dll resides in my code folder.
I have also registered cfront.ocx manually from my code folder.
I have called SetNavisionPath() since i have multiple versions of NAV installed. Also the license file is loaded from network path.
It seems to me that the connection is not established with the SQL server but i don't know why although i can open the NAV db in SSMS.
Please help resolve this problem.
Regards,
Hemant
I have written a test applicaiton using C++ to connect to NAV database and update some records.
I am using NAV 2009 W1 R2 however i also have NAV 5.0 W1 installed on the same machine.
My NAV database resides on SQL Server 2008 R2.
My test application code is as below:-
#include "libload.h"
int main()
{
DBL_U8 *NDBCDriverName = (DBL_U8*)"NDBCS";
DBL_U8 *NetType = (DBL_U8*)"Default";
DBL_U8 ServerName = (DBL_U8*)"IM10\\SQLEXPRESS2008";
DBL_U8 *DatabaseName = (DBL_U8*)"TEST";
DBL_U8 *NavisionPath = (DBL_U8*)"C:\\Program Files\\Microsoft Dynamics NAV\\60\\Classic\\";
DBL_U8 *NavisionLicNameWithFullPath = (DBL_U8*)"P:\\WM40\\NAVLicence\\NAV2009\\license.flf";
if(SessionInit((DBL_U8*)"cfrontsql.dll") == 0)
{
DBL_SetNavisionPath(NavisionPath);
DBL_LoadLicenseFile(NavisionLicNameWithFullPath);
DBL_ConnectServerAndOpenDatabase(NDBCDriverName,ServerName,NetType,DatabaseName,0,0,1,0,0);
if(!DBL_GetDatabaseName(DatabaseName))
DBL_OpenDatabase(DatabaseName,0,0);
DBL_U8*CompanyNamePtr = DBL_NextCompany(CompanyNamePtr);
if(*CompanyNamePtr != '\0')
{
DBL_OpenCompany(CompanyNamePtr);
.......................
}
DBL_CloseCompany();
DBL_CloseDatabase();
DBL_Exit();
}
..................
}
When i run the above application it crashes in cfrontsql.dll at the line where GetDatabaseName() function is called.
I have converted libload.c to libload.cpp and have compiled it successfully. The cfront.ocx and cfrontsql.dll resides in my code folder.
I have also registered cfront.ocx manually from my code folder.
I have called SetNavisionPath() since i have multiple versions of NAV installed. Also the license file is loaded from network path.
It seems to me that the connection is not established with the SQL server but i don't know why although i can open the NAV db in SSMS.
Please help resolve this problem.
Regards,
Hemant
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
0
Comments
-
Try to copy license file to the folder with cfrontsql.dll.
Maybe that helps... Who knows )Sincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0 -
Thanks for your reply.
I tried doing this but with no luck.
Regards,
HemantRegards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0 -
Hi all,
Can someone help me out to resolve this?
Thanks,
HemantRegards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 324 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions