Jump to content
Blavatsky

Paradox in FireDAC Delphi 11 Ent 32bit VCL App

Recommended Posts

Hi,
I was wondering if anyone has had luck creating or knows how to create a
Paradox in FireDAC Delphi 11 Ent. 32bit VCL App [ simple DBGrid project }
after dropping a FireDAC.Phys.ODBC.Wrapper component on the DM1 datamodule which is linked
to the mainform and mentioned in USES clause eg DM1;
I run F9 and get an error message.
The weird thing is the DBGrid populates at design-time after checking active in TQuery component, but,
things go downhill after hitting RUN-F9... as that when the error comes up.
I did notice in some project versions of the exe -file  it would run and appear to operate ok but an error  message came up as well which was disconcerting. The compiling error was a given.
So, can someone please help me get it to run without errors.
I have attached a zip file of the project which uses Delphi 11 user sample data
so you will have to redefine "ODBC Advanced " section to put in "path/driver info" in the Connection Component Editor by right-clicking on it to change it... part of the path statement... not too hard to do that, and, then TEST CONNECTION and then save. Then RUN.
code for "ODBC ADVANCED" section in Connection object on DM1 [design mode] should look similar to this

DriverID=538;Fil=Paradox 5.X;DefaultDir=C:\Windows\System32;Dbq=C:\Users\Public\Documents\Embarcadero\Studio\22.0\Samples\Data;CollatingSequence=ASCII;

So, I click RUN with debugger
first message...
Project Paradox_ODBC_Project3.exe raised exception class EODBCNativeException with message '[FireDAC][Phys][ODBC][Microsoft][ODBC Paradox Driver] The Microsoft Jet database engine cannot open the file '(unknown)'.  It is already opened exclusively by another user, or you need permission to view its data.'.

Second message...
Exception EODBCNativeException in module Paradox_ODBC_Project3.exe at 0035BB8D. [FireDAC][Phys][ODBC][Microsoft][ODBC Paradox Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.

both messages are very similar.
Don't forget to close all.... and terminate process.

Any help is always appreciated.
Blavatsky

Paradox_ODBC.7z

Edited by Blavatsky

Share this post


Link to post

If you have the query or connection active in the designer make sure to deactivate it before trying to run the app from the IDE.

  • Like 1

Share this post


Link to post
1 hour ago, PeterBelow said:

If you have the query or connection active in the designer make sure to deactivate it before trying to run the app from the IDE.

Yes, I know but the main issue remains... the errors during compile

Share this post


Link to post
21 minutes ago, Blavatsky said:

Yes, I know but the main issue remains... the errors during compile

Since you never said what the compile time errors were not much anybody can do to help. Also since you mention runtime errors most would assume you already solved any fatal compile time errors. 

Edited by Brian Evans
  • Like 1

Share this post


Link to post
17 hours ago, Brian Evans said:

Since you never said what the compile time errors were not much anybody can do to help. Also since you mention runtime errors most would assume you already solved any fatal compile time errors. 

Actually, if you read the post both messages are there in black and white...
Not, the help I was looking for ... actually what you meant to say was run-time errors.
Compile-time and design-time are take to be the same thing.

Edited by Blavatsky

Share this post


Link to post

Those are both runtime error messages. They are also both for the same exception : first from the debugger and then (if you select continue) from your application.

 

If those are your only errors then the answer was already posted. Paradox files can't be opened by both the IDE live form designer AND an application being run in the debugger at the same time. You need to close the FireDAC connection on your datamodule in the IDE and then open in code when the application runs. Or use ConnectedStoredUsage with auRunTime set to false for the FireDac connection and setup a connection at runtime to another paradox file (preferred method - lets you use the live designer features).  

 

 

Edited by Brian Evans

Share this post


Link to post

I cannot see any compile error shown in the original post either. There is only one reference which doesn't make any sense:

8 hours ago, Blavatsky said:

The compiling error was a given.

 

Share this post


Link to post

Somebody gave me a two part solution.
Half of which was kindly mentioned here, so thankyou.
To reiterate.
A) turn off CONNECTION object property "CONNECTED" to FALSE
B) This part, which nobody here mentioned, sorry, was to add code to the Datamodule's "ONCREATE EVENT"
such as..
  FDac_Con1.Connected := True;
  fdqry1.Active := True;

I am a newbie, with wrinkled skin.....
Have a NICE DAY and please forgive my ineptness.

Share this post


Link to post

For completeness. This project only runs on Paradox 5 structure tables and not Paradox 7 which is where I am headed.
Does anyone know a fix for this ?
Do we need a odbcjt32.dll for Paradox 7 ? If so where can one find it ? Or is there another work around ?
Does this file (odbcjt32.dll) need to be in c:\windows\system32 or c:\windows\WinSxS ?

Share this post


Link to post

Are you considering a normal DB? The paradox is 30 years old and brings nothing but trouble. Do you want to worry about it all the time?
I'm converting, I'm robbing one program with Paradox to D11. The first thing was throwing away Paradox and exporting/importing its data to a relational DB. Firebird.
It Connected and Active needs to go from OnCreate out. You've already figured that out.
PS: I'm using my own solution. I'm only inspired by the content of the individual forms and the logic of the program.

  • Like 1

Share this post


Link to post

I too migrated a system away from Paradox a long long time ago. Paradox was good in it's time but it's limitations (particularly for a multi-user interface to the database) are very significant. I would definitely migrate to a modern and supported database (there are several open-source type solutions that are only a free of charge download away....)

  • Like 1

Share this post


Link to post
4 hours ago, Roger Cigol said:

In the unlikely but not impossible event that you have field names in your paradox tables that include the # symbol I point you to this posting:

Upgrading paradox field names containing # symbol

I did it via csv files. There were/are only 16 tables. It is very easy to treat the character there.

Share this post


Link to post

I did find this article.. that claimed some success, but, I am doubtful it will work on my system as MY SYSTEM seems to baulk and stutter whenever I add MS Access Drivers... I expect that once I create a UNICODE Firebird or .mdb version TO REPLACE  my old ANSI DB text editor THEN I CAN PUT THIS ISSUE TO REST TOO.

https://stackoverflow.com/questions/49629776/how-to-read-and-write-to-a-paradox-7-x-database-from-net-app

AND THIS WAS LINKED TO IT ALSO....


https://social.technet.microsoft.com/Forums/lync/en-US/b31f8ed5-7f53-4d1d-901f-93f1dd5e13ae/windows-7-error-unexpected-error-from-external-database-driver-11265?forum=officesetupdeploylegacy

Edited by Blavatsky

Share this post


Link to post

Hello,
It is Thursday 10th August 2023.
I finally got the Paradox 7 database ( ~ 120 Mb) to open in a DBGrid in Delphi 11.
HIP HIP HOORAY.
1) I used the Embarcadero BDE installation. Control Panel then search "BDE" for BDE Admin
When using BDE Admin "USE AS ADMINISTRATOR"
2) Navigate Configuration>Drivers>Native>Paradox and  then goto Net Dir and Change it to where
you keep your Paradox 7 Database Table files eg .db/.md/.px
Then click "APPLY EDITS"
close and re-open BDE Admin to verify change.
3) Open ODBC Data Sources (32 bit version for 32 bit APP)
If you already have a Paradox DSN edit it by clicking "Configure"
Change folder directory to where you store your Paradox 7 database table eg .db
4) Once the above is done open "CONNECTION POOLING" TAB
and change mdb to pooled
and change both Paradox .db to pooled.
I only have the last one as I deleted the first one (.db driver) from REGISTRY. ( to avoid overlap)
5) I also changed permissions for my BDE folder to read-write
then I added string in ODBC ADVANCED in my Connection object on the Datamodule
to something like... no spaces or linebreaks

Provider=MSDASQL;Persist Security Info=False;Mode=Read;Extended Properties='DSN=Paradox;DBQ=C:\Delphi_DB_Projects\Paradox_7_ODBC_DICTIONARY\tables;DefaultDir=C:\Delphi_DB_Projects\Paradox_7_ODBC_DICTIONARY\tables;DriverId=538;FIL=Paradox 7.X;MaxBufferSize=2048;PageTimeout=600;';Initial Catalog=C:\Delphi_DB_Projects\Paradox_5_ODBC_DICT5\tables;

6) I would like to mention that I copied a PDOXUSRS.NET (13kB) to the folder containing the Paradox 7 database table.
then I compiled [F9] with debugging after
going to connection object and turning off by unchecking "CONNECTED" and
query object property "Active" to FALSE

VOIR-LA
it works
Mission Impossible,.. well at least it felt like it
Enjoy

Paradox7 FireDAC ODBC without datasource name_10082023.jpg

Edited by Blavatsky

Share this post


Link to post

Hello again,
I changed Mode=Read; to  Mode=ReadWrite; ( in the ODBC ADVANCED property of FD Connection Object)

Then I recompiled and added a new entry French field "Eureka" and saved and refreshed it.
I clicked last entry and waited a while... then I clicked add new entry "+" button on the DBNavigator bar.
Voir-La it accepts new entries/rows.
So, I noticed AUTOINC is working OK.

Paradox7 FireDAC ODBC without datasource name_AutoInc_works_10082023.jpg

Edited by Blavatsky

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

×