#1  
Old 14th September 2007, 12:19 AM
David Charron
 
Posts: n/a
Default Access Violation when package part of sparelib or packages

Hi,

I'm using BCB6.
I've upgraded my projects from 1.08 to 2.072.
I've clean up the .bpr to remove the reference to 1.08 package
Everything compiles fine.
The first time I compile the NexusDB207*.lib are not in the SPARELIBS
section.
The program execute fine and everything works.
The second time I compile NexusDB207*.lib are added to the SPARELIBS section
of the .bpr.
The program compile fine. It execute but crash when it reach this line.
TnxQuery* nxQueryMemberOfGroup = new TnxQuery(NULL);
nxQueryMemberOfGroup->Session =
DMServerEngine->nxSessionDMServerEngine;
nxQueryMemberOfGroup->Database =
DMServerEngine->nxDBServerEngine;
nxQueryMemberOfGroup->Timeout = 5000;
nxQueryMemberOfGroup->SQL->Add("SELECT GroupName FROM
AccessGroup"); //<=== CRASH HERE Access Violation

The object is created correctly. It get assigne the property but crash when
you try to access the SQL property.

If I edit manually the .bpr and remove the refence to the NexusDB207*.lib
from the SPARELIBS section I can recompile and execute the program correctly
without a crash. When I recompile after that I get the access violation
describe above again. (the NexusDB207*.lib are added again to the .bpr)

I tryied to add the NexusDB207*.bpi to the PACKAGES section of the .bpr but
it didn't solve the Access violation even if the NexusDB207*.lib where not
added to the SPARELIBS.

Here's my question. Is there any way other than manually cleaning the .bpr
everytime I compile to fix this?
I know the problem isn't with NexusDB code but with the way BCB6 links it.
I tryied with 2 different projects and still get the error. I've tryied to
reorder the SPARELIBS section so that NexusDB207*.lib are the first to be
use.
I tryied to put NexusDB2 and NexusDB2\Builder6 as the first directory for
the include and the library. Didn't fix it.

I'm out of idea to try out. Any idea are welcome.

David Charron


  #2  
Old 14th September 2007, 02:24 AM
Rodrigo Gómez [NDX]
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

Hi David,

Sorry to hear you're having so much issues with BCB6 and NX2...

Are you linking your app with dynamic RTL and runtime packages? If so, try adding ALL the
BPI files of nexus, except the DV, to the used packages in the project (best way to add
this is using the project options, not the project source). I know this adds some bloat,
as there are several packages that you probably don't use/need, but I have found that it's
better to have this than have BCB adding and screwing up my project from time to time. And
you can actually avoid deploying the ones that you don't really use, even if they are
added to the PACKAGES/SPARELIBS section of the project.

Also, check that you don't have anything in the LIBRARIES section of the project. That's
very important in case you have several BPL/DLL as part of your project, that also use
some of the packages. BCB will link without much problems two projects, one that depends
on another, even if the two have the same LIB in the LIBRARIES section. But when you try
to run you'll get errors about units being included in one and another, and so on.

As far as I know, you need to have the lib and the bpi added in the SPARELIBS and PACKAGES
sections of the project, but the LIBRARIES section must be clean.

Hope this helps,

--
Rodrigo Gómez [NDX]
Aguascalientes, México, -6 GMT
  #3  
Old 14th September 2007, 03:30 AM
David Charron
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

Hi Rodrigo,
Thanks for helping

""Rodrigo Gómez [NDX]"" <rodrigo.gomez@ndx.nexusdb.com> wrote in message
news:46e95617$1@nexus-vkpb9bih5.Nexus.local...
> Hi David,
>
> Are you linking your app with dynamic RTL and runtime packages?

YES.

>If so, try adding ALL the BPI files of nexus, except the DV, to the used
>packages in the project (best way to add this is using the project options,
>not the project source).

I tried it before. I gave it another shot. I still get the access violation
discused before.

> Also, check that you don't have anything in the LIBRARIES section of the
> project.

I've checked and it's empty

> As far as I know, you need to have the lib and the bpi added in the
> SPARELIBS and PACKAGES sections of the project, but the LIBRARIES section
> must be clean.

Adding the .bpi to the package didn't add the .lib to the SPARELIBS.
I'v added them but I still get the acces violation with all the nx package
added to the PACKAGE and the SPARELIB (except the nxdv).

Anything else I can try?

David Charron


  #4  
Old 14th September 2007, 03:40 AM
Rodrigo Gómez [NDX]
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

Hi David,

Would it be possible to have some kind of test project to try it here?

I don't really know what else could be, but if you can create a small test app that I can
try I will see what happens here with it.

Regards,

--
Rodrigo Gómez [NDX]
Aguascalientes, México, -6 GMT
  #5  
Old 14th September 2007, 06:04 AM
David Charron
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

""Rodrigo Gómez [NDX]"" <rodrigo.gomez@ndx.nexusdb.com> wrote in message
news:46e967f7$1@nexus-vkpb9bih5.Nexus.local...
> Hi David,
>
> Would it be possible to have some kind of test project to try it here?


Sample project posted to the binaries under
"Access Violation when package part of sparelib or packages (Sample Project)
<= For nexusdb.public.support.cbuilder"

Thanks

David Charron


  #6  
Old 14th September 2007, 06:16 AM
Rodrigo Gómez [NDX]
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

Hi David,

I have just tried it. The EXE you sent me crashed, but when I rebuild it it doesn't crash
anymore.

I don't have 2.07.02 installed in BCB, only 2.07.00.

Could it be possible for you to try with 2.07.00? I'll try installing 2.07.02 in a VM, now
that I figure out why VMWare doesn't want to run here anymore (it just restarts my
machine, without any warning/error or anything like that). I can't change right now the
version in the IDE in my work-machine.

Anybody else using 2.07.02 in BCB6 around here??

Regards,

--
Rodrigo Gómez [NDX]
Aguascalientes, México, -6 GMT
  #7  
Old 15th September 2007, 01:21 AM
David Charron
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

I've copied the same nexusdb2 vcl directory into a VM with BCB6.
I've compile the same problematic sample project.
And guess what. It works. No access violation.
I must be something with my main environment that's causing this.
I've search my system for older version of the nexus file and I cannot find
any.

humm... any other idea to try out?

David.



Last edited by Piko : 5th December 2008 at 10:24 AM.
  #8  
Old 15th September 2007, 07:50 AM
Rodrigo Gómez [NDX]
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

It would seem then that the problem is not with Nexus itself...

Do you have the exact same components in that VM with BCB6? Maybe it's something else what
is causing the issue with NX in your main environment. Do you have some kind of exception
trappers? Because the test project you sent me did fail here, but I don't think it had any
dependence on any external library/bpl, at least that I didn't have. So it appears that
the EXE is beign incorrectly linked or something like that.

Do you have the latest linker version in your main envoronment?

I'm sure this all sound like pretty dumb questions, and maybe you have already asked them
yourself, but it's the only thing I can think of :-/

HTH,

--
Rodrigo Gómez [NDX]
Aguascalientes, México, -6 GMT
  #9  
Old 18th September 2007, 06:44 AM
David Charron
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

Using VMware I was able to pinpoint kbmMW package as the cause for the
error.
As soon as I compile the runtime package of kbmMW I get the error using the
test project (see binaries).
kbmMW uses nexusDB lib file. They are in the required file.
I'm investigating more deeply what is causing this incompatiblity.

Rodrigo did you have this problem in the past?

David Charron


  #10  
Old 18th September 2007, 11:02 AM
Rodrigo Gómez [NDX]
 
Posts: n/a
Default Re: Access Violation when package part of sparelib or packages

Hi David,

Well, at least you know where is or seems to be the problem :-)

I have never had this error, AFAIR. But I don't use kbmMW.

Could it be that kbmMW is linked with a previous version of the NX source?

--
Rodrigo Gómez [NDX]
Aguascalientes, México, -6 GMT


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EM V2 access violation Roberto Nicchi nexusdb.public.support 1 6th April 2009 11:13 PM
Access Violation when package part of sparelib or packages (Sample Project) <= For nexusdb.public.support.cbuilder David Charron Binaries 0 14th September 2007 06:03 AM
Access violation Konstantin nexusdb.public.support 1 12th September 2007 07:48 AM
access violation Alexandre Eduardo.·. nexusdb.public.support 3 7th June 2007 05:16 AM
v2.02 Access Violation David Charron nexusdb.public.support.sql 1 14th September 2005 12:30 PM


All times are GMT +11. The time now is 06:45 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.