PDA

View Full Version : Sample Program - Error 1009


itognet
February 24th, 2015, 01:49 PM
Hi, for years ago I tried the sample program where the sample created Doctor Bart De Hantsetters in the CommitCRM - and it worked very well at that time.

Now I want to use the sample program again, but I just cannot get it to work.
The error is: Commit Init failed. Error code: 1009 which is : Path specified for CommitCRM DB folder not found.

So this should be easy... but I have verified the path serveral times. I have tried adding a \ at the end of the path. No luck.

I know that it can see the network drive, because it finds the CmtDBEngDll file with ease.

CmtDbEngDll = 'I:\CRM\ThirdParty\UserDev\CmtDbEng.DLL';

The database path is 'I:\CRM\db'

Notice: I have not changed the sample test at all. Only the path to the DB and to the VmtDBEngDll file.

What have I tried?
1. tried it from multiply computers.
2. CommitCrm is able to start up.
3. I have reset the permission for the CRM folder, Everyone=full access on all directories and files.


Can you give me any guidelines for how I can get the sample program to work again.
Thansk.

Support Team
February 25th, 2015, 06:04 AM
API error 1009 means exactly what you refer to. However, it is possible that the problem is with privileges to access the DB folder or any of files it contains, unlike the ThirdParty... folder.

Please reapply access rights and permissions so all users be able to access this folder and all of the files it contains. You may believe that this is the case already but nonetheless reapply these settings.

In case the above does not help please try setting a UNC based path to this folder, unlike using the mapped drive letter i . This sometimes bypasses other type of access rights issues.

Last but not least, 4 years ago our API libraries were different, so in case you are using the API libraries (VB.NET, C# or C++), unlike using the low level API, then you may want to download a newer version. You can contact us by email for this.

Hope this helps.

itognet
March 28th, 2015, 05:13 PM
Okey. I have made some digging in this...

This is the Scenerio:

I have reapplyed the access rights and permission from the server.
I have changed the demo to use UNC ( \\server\sharing\path )

I compiled the Demo on an old XP.
The executable runs fine on the XP, and creates Mr. Bart :-)
The executable runs fine also on 2 Windows 7 64 bit. Mr. Bart is created :-)

When this executable is able to create Mr. Bart on the Windows 7 machines, then I assume that the access rights is okay.

-----
Then I compile the exact same project on two different Windows 7 machines, but when I run the executable from the XP and from the 2 Windows 7 machines, it gives this error:

CommitCRM Init failed.
Error code: 1010
Desc: 慐桴猠数楣楦摥映牯䌠浯業⁴䉄映汯敤⁲潦湵Ɽ戠瑵椠獴挠湯整瑮⁳潤渠瑯爠晥敬瑣愠瘠污摩䐠⁂潦 摬牥.


It works when it is being compiled from an Windows XP machine, but not from a Win 7 maschine.

What am I doing wrong? - You write something about downloading a newer version.
Could it be that ?

Btw, Why is the desc in chinese ? and how to change that ?

itognet
March 28th, 2015, 08:58 PM
After some real digging...

and I have found out why it cannot find the database.

Database = 'C:\CommitCRM\db';


I found out that CmtDbEng.DLL do not handle the database string correctly.
It crops the string to only the first character !!

A process explorer reveals this:
Open file: C:\Users\dennis\Desktop\CommitBart\c\DBSys\CommitS erver.sr1
Open file: C:\Users\dennis\Desktop\CommitBart\c


--
If I change
xDbPath : PChar;
to
xDbPath : PAnsiChar;

it works perfect, it connects to the database, on local, on mapped drive and UNC - with no problem.


When I change
aStatusErrCode : Pchar;
to
aStatusErrCode : PAnsichar;

The chiniese text is now in english - great.


But but but, I still have one last problem (probably caused of the char/ansichar string/ansistring problem)

I get this error: Insert new Account. Error code: 1100 ( which is Database access error)

Will you please update
this article

so it updated with ansichar / ansistring

I really need this, so I can continue. Thanks.

Support Team
March 30th, 2015, 06:05 AM
It seems that you are using the (very) low level DLLs and this is not the recommended way of using RangerMSP API. It will work but not recommended. It changes a lot and you should instead use the upper level programming API libraries that are MUCH easier to work with, wrap all low level communications and APIs and makes building apps that integrate with RangerMSP a breeze. And just like you mentioned, a single byte string types should be used when using the low level API.

itognet
March 30th, 2015, 06:23 AM
I am talking about the "Hello world / Create Mr. Bart" example situated here.

I am using Delphi, and as I can see you don't provide upper level programming API libraries for Delphi so I am forced to continue using the low level (whichs works perfect when compiled from XP but not from Windows 7, proberly caused by that your CmtDbEng.DLL do not support AnsiString)

What advice do you have ?

Support Team
March 30th, 2015, 06:38 AM
The dll supports the exact types listed in the sample (That seems to be working very well when we use it). You should not attempt to force a type cast as it might fail.

The dll is used by RangerMSP and works well on XP, Vista, 7, 8, and 8.1, 2003*, 2008*, 2012* (e.g. all Windows editions currently available) both in 32 bit and 64 bit OSs.

I suspect that something isn't configured well, maybe it's a compilation setting, something.

We understand that you want to use Delphi (which is absolutely great), though you may want to consider using VB.NET/C#/C++ and implement much faster.

itognet
March 31st, 2015, 01:48 AM
I found the error.

It was a combination of updating your code. Everthing has to be ansichar, ansistring, pansichar etc. else it will not find the path for the database.

Then the code works and compiles perfect.

I am RDPing my Windows 7 PC. CommitCRM runs fine (after the RDP change for commit that you have specified).

.... The exact same change has to be done for my compiled executable.
I need the ads.ini in the same directory.

Problem solved.