ADOFUNC.prg e SQLEXPRESS

ADOFUNC.prg e SQLEXPRESS

Postby mauri.menabue » Fri Mar 19, 2021 4:58 pm

Hello everyone

I decided to try using MSSQL EXPRESS to do this I thought I'd start
using the functions in ADOFUNC. PRG I was wondering:

1) If it is the best way to start or it is better to use ADORDD

2) How to run an Rlock or Flock to prevent two users from working
on the same record or groups of records.

3) If there is a need to do maintenance on compaction, reindexing

Thank you
Maurizio Menabue
User avatar
mauri.menabue
 
Posts: 155
Joined: Thu Apr 17, 2008 2:38 pm

Re: ADOFUNC.prg e SQLEXPRESS

Postby nageswaragunupudi » Fri Mar 19, 2021 7:30 pm

1) If it is the best way to start or it is better to use ADORDD


We recommend using FWH adofuncs.
You can directly work with ADO without any of these functions, but using adofuncs makes your life very easy.

3) If there is a need to do maintenance on compaction, reindexing

No need for SQLEXPRESS, MSSQL, ORACLE, etc.
Well, you need to do it if you are using MSACCESS and adofuncs have function to do this.

2) How to run an Rlock or Flock to prevent two users from working
on the same record or groups of records.


We can open a table with optimistic locking or pessimistic locking. Mostly tables are opened with optimistic locking and there is no need to locking.
If we open a table with pessimistic locking, we can use record locks.
We advise you to unlearn DBF programming habits and record locking is not desirable or practiced normally.
Anyway, it is upto you.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ADOFUNC.prg e SQLEXPRESS

Postby mauri.menabue » Sun Mar 21, 2021 8:21 am

Hello everyone
I would ask for further clarification on these aspects:

1) Is it possible to open multiple cursors (aliases) for the same table?

Code: Select all  Expand view


    E.g. (x)Harbour LOCAL cALIAS1 := cGetNewAlias("CUSTOMERS")
                            LOCAL cALIAS2 := cGetNewAlias("CUSTOMERS")

                           USE NEW ALIAS CUSTOMERS (cAlias1) ....
                           USE NEW ALIAS CUSTOMERS (cAlias2) ....

 


2) By default you don't need to define any type of lock, so I suppose if two users
vary the same record and both confirm the change in the record update
with a timeline, or rather the variation of the last
user confirming the transaction, I wonder if there is no function that warns a
user that someone (better than user) is already working on that record.

TIA
User avatar
mauri.menabue
 
Posts: 155
Joined: Thu Apr 17, 2008 2:38 pm

Re: ADOFUNC.prg e SQLEXPRESS

Postby nageswaragunupudi » Sun Mar 21, 2021 10:36 am

1) Yes.
2) If both users are working on the same record at the same time after one user saves changes the other can not save his changes. He will get an error. The second user has to cancel his changes, read the record again, and then do whatever.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests