VB 2010 - lock/unlock DBF files via BDE (part 2)

Hi,

I need to set lock on DBF (dBase) table via BDE API in Visual Basic 2010. Similar like Delphi procedure:

TTable.LockTable(LockType: TLockType);

My questions are:

1. Should I open the table before locking and get its handle? If yes, how can I open the table via BDE API?

2. What happens on HDD, when lock is set? (the attribute od file DBF is set to read only, or BDE creates some temporary file as lock, or BDE writes somewhere the information, that this table is locked)

Thanks
skdanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert GOracle dbaCommented:
the flaw with dbase is that anyone with access to the files can just delete them

move the data to a real database, like mssql, oracle, interbase, ...
bde is deprecated, it's over 10 years now

you'll loose a day or 2 converting to another database
but you'll find it's worth every bit of that time
you wouldn't have to recreate the indexes every week ...

dbase isn't really multiuser, the bde just mimicks it in a very good way
0
skdanAuthor Commented:
I agree, but currently I am creating an application, which will use the same data (dbf files) like other older application created in Delphi. Users are using that older application in network. I can't change it.
0
Geert GOracle dbaCommented:
it's probably easier to rewrite the whole thing and then add your extra functionality ?

how hard can it be to convince management to renew the app for which there doesn't seem to be anybody around anymore to support it ?

if you have the delphi sources, find an (external) delphi dev to extend it (and convert to new db)
0
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

skdanAuthor Commented:
That Delphi application is older, but still in use, with support, upgrades and so on. My application adds some funcionality, which Delphi programers don't plan to add to their application. They created the new system with SQL server, but it will take some time, when all users move to new version. But I agree, this is the future, of course.
0
Sinisa VukSoftware architectCommented:
some way agree with Geert_Gruwez but can help you more...

1. Yes, handle of table is needed for locking.
not vb but can help too....
http://www.codeproject.com/Articles/13/Accessing-the-Borland-Database-Engine-BDE-from-Vis
http://www.gentle.it/alvise/BDE.HTM
I rather go with odbc api or ado - not bde
http://www.bigresource.com/VB--VB-ado-to-dBase-III-Plus-hgLuyGlppx.html
http://forums.aspfree.com/visual-basic-programming-38/opening-dbf-file-using-adodb-connection-41404.html

2. I really don't use dbase but locking is working, with ado you can specify locking too...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
skdanAuthor Commented:
It's a good idea to try it with ado. I will try it. Thank you very much.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.