MariaDb ADO Connection Errors

Moderator: Rathinagiri

Post Reply
User avatar
karweru
Posts: 147
Joined: Fri Aug 01, 2008 1:51 pm
Contact:

MariaDb ADO Connection Errors

Post by karweru » Sat Apr 15, 2017 3:49 pm

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.
Kind regards,
Gilbert.

User avatar
Rathinagiri
Posts: 5123
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 112 times
Been thanked: 114 times
Contact:

Post by Rathinagiri » Sat Apr 15, 2017 5:16 pm

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?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
karweru
Posts: 147
Joined: Fri Aug 01, 2008 1:51 pm
Contact:

Post by karweru » Sun Apr 16, 2017 10:57 am

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.
Kind regards,
Gilbert.

User avatar
serge_girard
Posts: 1774
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 237 times
Been thanked: 55 times
Contact:

Post by serge_girard » Sun Apr 16, 2017 12:35 pm

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

User avatar
dragancesu
Posts: 431
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 3 times
Been thanked: 57 times

Post by dragancesu » Sun Apr 16, 2017 3:56 pm

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?

Post Reply