Accessing Navision through C/Front with VB6.00

Hi, When using C/FRONT connecting to Navision Database through Server connection, I have this error message “Internal error 182 in Module 1”. What does that mean? I have tried looking through the thread that Fabian displayed all the interal errors but I didn’t see the error I got. Also, when connecting through “opendatabase” function, I have no problem in accessing Navision at all. So how does one access the Navision with Server connection with C/Front? Can someone show me a snippet of code please. Here is the code of accessing the server connection that I used: dim aa as object Set aa = CreateObject(“cfront.cfrontctrl.1”) aa.LoadLicenseFile LicenseFile Call aa.ConnectServer(“TestServer”, “tcp”) <==== produced error here Call a.Login(UserIdT, PasswordT) aa.OpenCompany companyName Best Regards, Ty

hi Shark, just search on cfront , you will find the solution, there are a lot of replies for this

Hi AJay, I have tried reading all the threads. It seems like there’s nothing useful to my problem. Best Regards, Ty

Try replacing “TestServer” with IP address, such as “192.168.0.100”.

Hi Shark, do onething , add an ocx of cfront in your vb project. put it on the form and try it , it should work , i tried here and do not use call method.

Shaman, Yes I did try the IP address, but I have no luck in getting it to work either. Ajay, Yes I did add an OCX to my project, I did it that way too. It doesn’t work either. It works fine connecting with “Databaseopen” function, but it gave me problem when using the “Serverconnection” function. Thank you for all your helps. Best Regards, Ty

Hi, There are some Examples in CFront, i.e. Excel files check the macro code at the back you will find the answer. As far as i think there is come syntax error here. Vishal

Try remove line: aa.LoadLicenseFile LicenseFile This func. is used to load specific license (not default)

Vishal, I have tried the excel spread sheet that they had, when I run with the server connection function it produced the error that I have mention above too. Thank for you help :). Dalius, Yes I did remove that loadlicenseFile function, but it still gave me the error. Or is it possible that I used the wrong C/FRONT? I am working on the Navision 2.60B with the C/FRONT “W1 2.60.E”. Also I have tried with a couple of other C/FRONT version, but it doesn’t work either. Best Regards, Ty

Hi, Well, its funy, but i tried and works fine with me. as i had developed a VB interface to access Navision using C/Front for some requirement, didnt have a problem at all. Check if your license file has C/Front rights, Have you added the server IP and Name in your Hosts file ?? and try adding this aa.StopOnAllExceptions = False and check lemme know if it works in the meantime I will try & figure out if I can get you more help. Vishal

If you are able to open local database, then start on your PC Navision server. Try connect to server using this code. If it goes OK, then check your server license, CFront version.

another remark : Like i can notice you installed multiple navision and cfront versions on your pc. Have you used the “setnavisionpath” path command ? Greetings

This code works for us: Set cfrNAV = CreateObject(“cfront.cfrontctrl.1”) 'Dont know why this line is added? cfrNAV.StopOnAllExceptions = False 'Connect server Call cfrNAV.ConnectServer(Servername, NetType) 'Login cfrNAV.Login Username, Password 'Open company Call cfrNAV.OpenCompany(Companyname) Another thought: When Navision is opened it starts with the Cronus.flf or Fin.flf in the Navision program files directory of your PC. Maybe the used license file doesn’t allow the use of C/FRONT. Only after connecting to the server the license file of the server is loaded. Try to copy the server license file to your Navision program directory as Fin.flf.