Page 1 of 1

MariaDb ADO Connection Errors

Posted: Sat Apr 15, 2017 3:49 pm
by karweru
Happy Easter everyone,

I have recently been able to connect to a mariaDb through an ADODB connection and is able to programmatically create tables, insert/update/delete records.

My issue now is how to trap errors that may occur during an ADODB connection query execution. For instance, when i attempt to insert an already existing record, the program crashes. Is there a way to test for the error, and instead of the program crashing, just inform the user that the record already exists?

I'll be grateful for any assistance.

Re: MariaDb ADO Connection Errors

Posted: Sat Apr 15, 2017 5:16 pm
by Rathinagiri
I don't know much about ADO connection. However, if we do with BEGIN TRANSACTION and COMMIT we will not come across any database integrity problems.

I don't have any program crash problem in native connection to MariaDB. Is ADO faster than natural connection?

Re: MariaDb ADO Connection Errors

Posted: Sun Apr 16, 2017 10:57 am
by karweru
Thank you Rathinagiri,

I haven't done any speed tests comparisons, but i find ADO very fast. My motivation of using ADO was mainly driven by a desire to keep my program 'monolithic'...no dependencies on external libraries, plus it supports a very wide range of RDBMS, only requiring one to install a driver.

Re: MariaDb ADO Connection Errors

Posted: Sun Apr 16, 2017 12:35 pm
by serge_girard
Hi Gilbert, Does MariaDB not support errornames? In that case you could check on 'duplicate record' after INSERT. Else you should count(*) the unique key of the record you want to insert. If 0 INSERT else duplicate.

Serge

Re: MariaDb ADO Connection Errors

Posted: Sun Apr 16, 2017 3:56 pm
by dragancesu
I think that there is nothing simpler than natural links, one dll that's all

ADO is designed to work with MS databases, ODBC database to give manufacturers a client connects, it's not simply install software at the client, and adminstrative tools, set ODBC ...

ODBC sounds nice in theory but in practice it is difficult

Can you upload your program to see how it connects to the base?