Page 1 of 1
HMG ODBC Best Practices
Posted: Fri Mar 11, 2016 2:48 pm
by melliott42
Hello,
I realize HMG is mainly an amazing GUI. Though there are many ways to do things I may not be using the best suited for HMG now in 2016.
Could you please share a code snippet on how you have best found to connect and interact (SQL) with a database via ODBC and HMG 3.4.x?
Thanks,
Michael
Re: HMG ODBC Best Practices
Posted: Fri Mar 11, 2016 3:03 pm
by Rathinagiri
As you have mentioned, HMG is basically a GUI wrapper over Harbour. Harbour is having the functionality to connect to ODBC via hbodbc library.
This library is already included in every Harbour distribution along with a test program. Have you used that?
The file can be reached from hmg folder C:\hmg.3.4.2\HARBOUR\contrib\hbodbc\tests
Re: HMG ODBC Best Practices
Posted: Fri Mar 11, 2016 4:11 pm
by melliott42
Thanks Rathinagiri.
I have been using sddodbc. It connects well to Oracle 11g\12c and I can pull data OK into various HMG controls. Just wondering if there are any particular (ODBC or ADO or OCI) advantages or best practices with HMG.
I have not used hbodbc yet. Rathinagiri is that what you are finding works best with HMG for SQL databases, without buying third party products of course?
Thanks,
Michael
Re: HMG ODBC Best Practices
Posted: Fri Mar 11, 2016 4:37 pm
by Rathinagiri
Michael,
If you ask my experience, I always use native connection to any database and not ODBC.
I am using SQLite for single user system and MySQL (MariaDB) for multiuser systems. I need not change not more than 10 lines of code in my source files to change to any of these database systems. I use SQLCipher for encrypted database.
All these being open source, there is no dependency of third party products or performance loss.
Re: HMG ODBC Best Practices
Posted: Fri Mar 11, 2016 5:01 pm
by melliott42
Thats great feedback Rathinagiri! Thanks.
As I migrate apps to 64-bit HMG and start to create new ones it is a good time to reevaluate.