Jump to content
ertank

Definition [MAIN_DB] is not found in []

Recommended Posts

Hello,

 

I normally use UniDAC with MARS. This time, I have to use FireDAC and I am not used to FireDAC at all.

 

I checked MARS demo applications to prepare my INI file as below:

[DefaultEngine]
Port=8085
ThreadPoolSize=100

FireDAC.MAIN_DB.DriverID=FB
FireDAC.MAIN_DB.Database="D:\rest_server\SAMPLE.FDB"
FireDAC.MAIN_DB.User_Name=SYSDBA
FireDAC.MAIN_DB.Password=mypassword
FireDAC.MAIN_DB.Protocol=TCPIP
FireDAC.MAIN_DB.Server=localhost
FireDAC.MAIN_DB.Pooled=True
FireDAC.MAIN_DB.POOL_MaximumItems=100
FireDAC.MAIN_DB.TxOptions.Isolation=xiReadCommitted

When server tries to establish a database connection, client receives below error:

Internal server error: [EFDException] [FireDAC][Stan][Def]-254. Definition [MAIN_DB] is not found in []

Server EXE is built as a windows service application. Fbclient.dll file with correct bitness and version is in the same directory as my EXE file.

 

I have following in my code to make sure MARS uses certain definition in INI file.

  [Connection('MAIN_DB'), Path('token')]
  TTokenResource = class(TMARSTokenResource)

 

Any help is appreciated.

 

Thanks & Regards,

Ertan 

Share this post


Link to post

I used templates from scratch and it worked just fine.

I could not find what was wrong though.

 

Thanks.

Share this post


Link to post

Hi Ertan,

you MUST have the configuration line below, before the connection configuration.

 

DefaultApp.FireDAC.ConnectionDefName=MAINDB

 

Best regards,

Bob

  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×