Problems with CFRONT and Visual Basic

Tim81
Member Posts: 68
Hi,
i have a big problem. We need to change C/Front from the OCX to DLL.
So i made this little test script as a macro in Visio (where it is needed finally)
If it comes to the ConnectServerAndOpenDatabase function it always says something like: "The OS cannot load the DLL "path\nc_□@.dll"".
But the nc_tcp.dll, nc_tcps.dll, nc_netb exists. What is the problem??
i have a big problem. We need to change C/Front from the OCX to DLL.
So i made this little test script as a macro in Visio (where it is needed finally)
Private Declare Sub DBL_Init Lib "cfront.dll" () Private Declare Sub DBL_Exit Lib "cfront.dll" () Private Declare Sub DBL_ConnectServerAndOpenDatabase Lib "cfront.dll" (NDBCDriverName, ServerName, NetType, DatabaseName, CacheSize, UseCommitCache, UseNTAuthentication, UserID, PassWord) Private Sub ConnectToDatabaseDBL() Dim DatabaseName As String Dim DriverName As String Dim ServerName As String Dim NetType As String Dim UserID As String Dim PassWord As String DatabaseName = "database.fdb" DriverName = "NDBCN" ServerName = "localhost" NetType = "tcp" UserID = "super" PassWord = "" Call DBL_Init Call DBL_ConnectServerAndOpenDatabase(DriverName, ServerName, NetType, DatabaseName, 10000, 1, 0, UserID, PassWord) Call DBL_Exit Exit Sub End Sub
If it comes to the ConnectServerAndOpenDatabase function it always says something like: "The OS cannot load the DLL "path\nc_□@.dll"".
But the nc_tcp.dll, nc_tcps.dll, nc_netb exists. What is the problem??
0
Comments
-
So, i solved the first problem. Now the code looks like this:
Private Declare Sub DBL_Init Lib "cfront.dll" () Private Declare Sub DBL_Exit Lib "cfront.dll" () Private Declare Sub DBL_ConnectServerAndOpenDatabase Lib "cfront.dll" ( _ ByVal NDBCDriverName As String, _ ByVal ServerName As String, _ ByVal NetType As String, _ ByVal DatabaseName As String, _ ByVal CacheSize As Integer, _ ByVal UseCommitCache As Boolean, _ ByVal UseNTAuthentication As Boolean, _ ByVal UserID As String, _ ByVal PassWord As String) Private Sub ConnectToDatabaseDBL() Dim DriverName As String Dim ServerName As String Dim NetType As String Dim DatabaseName As String Dim CacheSize As Integer Dim UseCommitCache As Boolean Dim UseNTAuthentication As Boolean Dim UserID As String Dim PassWord As String DriverName = "NDBCN" ServerName = "localhost" NetType = "tcp" DatabaseName = "database.fdb" CacheSize = "10000" UseCommitCache = False UseNTAuthentication = False UserID = "super" PassWord = "" Call DBL_Init Call DBL_ConnectServerAndOpenDatabase(DriverName, ServerName, NetType, DatabaseName, CacheSize, UseCommitCache, UseNTAuthentication, UserID, PassWord) Call DBL_Exit DatabaseConnected = True Exit Sub End Sub
But now he always sais: "UserID and/or Password not correct." This is the failure message from navision. So he seems to connect to the DB, but he always denies the access.
Any ideas?
Thx in advance0 -
have the user permission for system object C/Front?0
-
Hi,
of course I have the permissions. If you try to use a license without that permission, you get a different error message.
But I heard that the cfront.dll is not working with Visual Basic at all.
There are two different "Calling Conventions".
a) _CDECL (C++, Delphi, etc.) The cfront.dll is compiled this way.
b) StdCall (VisualBasic)
So there is no possibility to use the dll with Visual Basic.
But we got the OCX work again. So we will use this further.
Thx
Tim0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K 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
- 320 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