Problem with Component

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Fastex
Posts: 15
Joined: Wed 20 Oct 2010 08:52

Problem with Component

Post by Fastex » Wed 20 Oct 2010 09:20

When I create a new project in Rad studio 2007/2009/2010/XE, I use TUniConnection and TAccessUniProvider, but when I compile the project, I get the Error :[ILINK32 Error] Fatal: Unable to open file 'ACCESSUNIPROVIDER.OBJ'.

I tried to find that file on my computer, but it isn't there.

I tried to use UniDAC on C++ Builder 6.0, this error was there, but I wrote links of includes and libraries in the project options. After it worked fine, because file ACCESSUNIPROVIDER.OBJ is in folder \UniDac for CBuilder 6\Lib\.

When I tried to do it in Delphi, it works fine.

How can I fix that problem ?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 20 Oct 2010 09:54

Hello,


To use AccessUniProvider with C++ Builder you should replace the following code

#pragma link "AccessUniProvider"
#pragma link "ODBCUniProvider"
with
#pragma link "accessprovider150.lib"
#pragma link "odbcprovider150.lib "

where XXX - is the version of your IDE
accessprovider110.lib - Rad Studio 2007
accessprovider120.lib - Rad Studio 2009
accessprovider140.lib - Rad Studio 2010
accessprovider150.lib - Rad Studio XE

it work for all of the UniProviders.

Fastex
Posts: 15
Joined: Wed 20 Oct 2010 08:52

Post by Fastex » Wed 20 Oct 2010 10:30

AlexP wrote:Hello,


To use AccessUniProvider with C++ Builder you should replace the following code

#pragma link "AccessUniProvider"
#pragma link "ODBCUniProvider"
with
#pragma link "accessprovider150.lib"
#pragma link "odbcprovider150.lib "

where XXX - is the version of your IDE
accessprovider110.lib - Rad Studio 2007
accessprovider120.lib - Rad Studio 2009
accessprovider140.lib - Rad Studio 2010
accessprovider150.lib - Rad Studio XE

it work for all of the UniProviders.
Can you write example of code, please ?

Fastex
Posts: 15
Joined: Wed 20 Oct 2010 08:52

Post by Fastex » Wed 20 Oct 2010 11:07

I wrote the code

Code: Select all

//---------------------------------------------------------------------------

#include 
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "accessprovider150.lib"
#pragma link "odbcprovider150.lib "
#pragma link "DBAccess"
#pragma link "Uni"
#pragma link "UniProvider"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
But now error :[ILINK32 Error] Fatal: Unable to open file 'ODBCPROVIDER150.LIB .OBJ'

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 20 Oct 2010 13:43

This is a correct empty template of *.cpp file to work with AccessUniProvider in C++Builder 2009

Code: Select all

//---------------------------------------------------------------------------

#include 
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "accessprovider120.lib"
#pragma link "odbcprovider120.lib"
#pragma link "UniProvider"
#pragma link "DBAccess"
#pragma link "Uni"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------

Fastex
Posts: 15
Joined: Wed 20 Oct 2010 08:52

Post by Fastex » Wed 20 Oct 2010 16:42

I don't know that I'm doing wrong, but this code doesn't work in my programm. Compiler wants file 'Accessprovider.120.obj'


Why Accessuniprovider.obj is absent in UniDAC 2007+ folder? I don't understand, because that file is in UniDAC C++ Builder 6.0 folder. I tried do it on 2 different computers. In Borland C++ Builder 6.0 it works fine. In other versions it doesn't want to work :(

May be do it like this http://www.devart.com/forums/viewtopic. ... hlight=obj

What do you think about it ?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 21 Oct 2010 08:58

Hello,


It seems to be a RAD Studio bug. The installed package should be automatically added to the default list of included packages when you create a new project, but it doesn't always happen.

The correct *.lib files for C++ Builder 2007 are accessprovider105.lib and odbcprovider105.lib

If the method, mentioned above doesn't help, you can try doing it in the way as it was written in the topic http://www.devart.com/forums/viewtopic. ... hlight=obj

John Lance
Posts: 3
Joined: Mon 18 Apr 2011 18:42

Post by John Lance » Mon 18 Apr 2011 19:19

AlexP wrote:It seems to be a RAD Studio bug. The installed package should be automatically added to the default list of included packages when you create a new project, but it doesn't always happen.
Where should this appear in the C++Builder Rad Studio XE file set? I'm using Windows 7 Pro 64 bit, and the current C++Builder Pro XE version of the Embarcadero product.

I would like to manually finish the installation into C++Builder so that I'm not fooling around with library "hide and seek" while attempting to use the trial version of the product.

Please see: http://www.devart.com/forums/viewtopic. ... 8404#68404

Thanks!

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 21 Apr 2011 08:21

Hello,

I have answered you by e-mail.

Post Reply