Jump to content
dogactopay

Delph ERP Help

Recommended Posts

Hello all,
Many years ago we had an ERP program made then several years ago the coders and project manager has been died and the company has gone down.So I am fixing the problems by making some changes in sql database or making small apps using python or smth to make sql querries automatically.But now I had a problem that I need to get in the Sql querries in the program.Shortly my problem is,when I open orders page it may take even 1 minute because in Sql querry tries to list all datas in the table before filtering.The inital querry when I open the order page is "SELECT * FROM ORDERS" and I need to add something like list only top 100 item.So I have many .bpl files which are lib files of program as I understand.So I couldnt look the .bpl files.So is it possible to make changes by bpl files?If yes how, what program?

Share this post


Link to post

First question, do you have source code from the program and or bpl files ?

Second, are you able to compile these? 

 

Share this post


Link to post

In my program folder I have many .bpl files some dcp files and exe file.

I dont exactly know where should I compile these bpl files.

I am able to open .bpl files with notepad++ and found the sql querry then I just added TOP 100 next to select but I got an error when I open program.

Edited by dogactopay

Share this post


Link to post

Bpl is basically just dll file with different extension (Borland Pascal Library). You cannot edit those in notepad. If SQL is in resources, then you might be able to change that resource with resource editor (if bpl is not digitally signed). But then your query will only ever return first 100 records.

Share this post


Link to post

First of all you can't just edit the compiled files in an editor. Forget about that. The BPL and DCP files are generated by the compiler when you compile the source code.

Since you're trying to do edit the compiled files I'm assuming you don't have the source for this application or can't recompile it for some reason - or have no clue about what you're doing (that's okay too 🙂).

 

If the queries are built in code, and you can't recompile, then you're pretty much out of luck as you would have to patch in the modifications at the assembler level. However if the queries are implemented in TQuery components, or something like it, and stored in DFM resources, then you can use a resource editor to extract the DFM of the form/datamodule where the query resides, change the SQL and then replace the DFM in the resource.

  • Like 1

Share this post


Link to post

Thanks a lot you guys,

I have tried resource editor but as I said I have only bpl and exe files so I could not find anything understandable so It seems It is not possible to edit it.As shown below I found the query in bpl file that I want to edit but when I add even space program does not work.

image_2021-02-09_173547.png

Share this post


Link to post
Guest

hi @dogactopay

 

As a general rule, if you don't have the source files, in the case of Delphi * .pas (unit with the source code) / * .dfm (forms), you won't be able to change your software! Even a skilled hacker will have a hard time doing it as it should be. Maybe some finishing touches, nothing more to expect!

 

Another thing, if you can view the contents of your SQL database, for example, if it is Interbase (IBConsole basic, it come with RAD), Firebird, MSSQL, Oracle, etc ... then, you can use many tools for this, and, if you are more lucky , your former programmer created "stored procedure" or "Views" to show records in a more elegant way in your "queries", so there is a chance that you can redo them without compromising the result in the application. However this does not guarantee success at all! See, try, and review the result!

 

Another thing, in a system with many records accumulated in a Database and its tables, it is very interesting that the application uses "filters" (either in the data access component or in its SQL statement) so that only records are displayed in portions , for example, as a pagination of "n" records at a time. This taking into account millions of records, or even the capacity of the hardware in use!

 

Finally, using a text editor like Notepad ++, you still risk corrupting the application's executable / DLL!

 

hug

Edited by Guest

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

×