Simple example of how to catch error (user-entered query)

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
myicq
Posts: 8
Joined: Sat 01 Jun 2019 16:11

Simple example of how to catch error (user-entered query)

Post by myicq » Wed 16 Dec 2020 15:42

I would like to allow the user in a software to enter queries for databases - and the software should connect to various types of database server over time.

Obviously the username will only be allowed to issue SELECT statements and use of databases. That is simple.

But how do I get and process an error from UniDac ? Could be in connection process (unknown user), or in SQL (issues command that is not permitted).

Other thoughts on the subject welcomed (ex: parameters vs SQL sanitizing)

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Simple example of how to catch error (user-entered query)

Post by MaximG » Fri 18 Dec 2020 16:47

Please see demo projects distributed with UniDAC for an example of how to handle errors :
[UniDAC Demo Folder]\Demos\UniDacDemo\ConnectDialog\MyConnectForm.pas

Post Reply