EASYSQL 2024.11.11 (A lot of changes!)

HMG Samples and Enhancements

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

EASYSQL 2024.11.11 (A lot of changes!)

Post by Roberto Lopez »

Hi All,

At first, this class must be considered EXPERIMENTAL.

My idea to start this small library, was to have a wrapper for 'Simple SQL Interface' contribution by Mindaugas Kavaliauskas that I've used for many years.

This wrapper should have the following features:

- Handle all possible runtime error situations (bad parameters, connection, SQL syntax, etc.).

- Show all required progress information and error messages to the user.

- Handle simultaneous connections in an easy/intuitive way.


This is a very very basic documentation:


METHODS:

New(): Object Initialization

Connect(cServer, cUser, cPassword, cDatabase): Connect to a MySql server.

Select(cCommand,cWorkArea): cCommand must be a MySql SELECT statement.
A recordset is created with the name specified as cWorkArea.

Exec(cCommand): Executes a MySql statement.

Disconnect(): Disconnect from server.

CloseAreas(): Close all workareas open with 'Select' method (if any).

Insert(cTable, aCols): Insert row. aCols, specifies xColumnname => xData pairs.

Delete(cTable, cWhere): Delete rows based on 'cWhere' condition.

Update(cTable,cWhere,aCols): Modify rows based on 'cWhere' condition. aCols, specifies
cColumnname => xData pairs.

AffectedRows(): Returns the number of rows that were modified by the last executed
INSERT, UPDATE, or DELETE

Destroy(): Set all class variables to NIL, closes all workareas created by
'Select' method (if any) and disconnects.


VARIABLES:

lError (Read Only): Returns .T. if an error occurred on last operation (.F. otherwise).

cErrorDesc (Read Only): Error description (Empty if no error).

lShowMsgs: Determines if error/progress messages will be shown.

lTrace: When set to .T., a file called 'trace.log' containing last command
executed will be written.


I hope it be util for someone.
Attachments
easy.sql.2024-11-11.zip
(1.7 MiB) Downloaded 152 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
serge_girard
Posts: 3338
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: EASYSQL 2024.11.11 (A lot of changes!)

Post by serge_girard »

Thanks !
There's nothing you can do that can't be done...
franco
Posts: 887
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: EASYSQL 2024.11.11 (A lot of changes!)

Post by franco »

Thanks for sharing.
All The Best,
Franco
Canada
User avatar
Steed
Posts: 438
Joined: Sat Dec 12, 2009 3:40 pm

Re: EASYSQL 2024.11.11 (A lot of changes!)

Post by Steed »

Tks
Post Reply