Help needed by vbdb new user 
Author Message
 Help needed by vbdb new user

Hi guys,

I am new to using DAOs and I believe I need some help from
'the gurus' so to speak.  I am presently doing a project
where I have to create a database and access that database
numerous times in the application.  All of this I have decided
to do in code because this is where I feel comfortable the most.

Since I don't have anybody around here that is Vb/Db experienced,
I have come for advice from those who are : Enter you guys.

The story so far....
I manupulate the database by creating dynaset recordsets and
using all it's different methods.  I decided on this because the
table-type recordset does not support SQL (a tool that I have a
good background in) and also because of it's other limiting
properties as compared with the dynaset-type.

Now, because of multiuser considerations, I need to implement a
a locking scheme. My problem is this, I get the following error
whenever I try to lock a table that is going to be updated:

 "Couldn't lock table 'name'; currently in use. (Error 3211)"

I try to lock the table with the following code:

  Set rsMyRecordset = dbMydatabase.OpenRecordset(MysqlQuery$, _
                dbOpenDynaset, dbDenyWrite)

...planning on doing the update on "rsMyRecordset"

Qtn1 : What makes a table "in use"? Opening a recordset from that
table maybe?

Qtn2 : Am I going to be able to use dynaset-Rs to efficiently
implement multiuser Applications. If not I am very open to
suggestions for this area or any other areas you feel I should
 know about.

Thank you for your time.

Oguja.

--



Fri, 03 Sep 1999 03:00:00 GMT  
 Help needed by vbdb new user

[so far, so good]

Quote:
> Now, because of multiuser considerations, I need to implement a
> a locking scheme. My problem is this, I get the following error
> whenever I try to lock a table that is going to be updated:
>  "Couldn't lock table 'name'; currently in use. (Error 3211)"
> I try to lock the table with the following code:
>   Set rsMyRecordset = dbMydatabase.OpenRecordset(MysqlQuery$, _
>            dbOpenDynaset, dbDenyWrite)

I think dbDenyWrite will prevent anyone from changing the tables
used in your query, even records not in your recordset, and will
prevent anyone else from opening up another recordset using the
dbDenyWrite flagon any of the tables. I wouldn't want two apps
that both mention the same tables and dbDenyWrite running at the
same time!

Quote:
> ...planning on doing the update on "rsMyRecordset"

I think you'll be better off with BeginTrans and CommitTrans
rather than with dbDenyWrite. Transactions can be faster, and
they let you use Rollback to undo your changes if you need to.
They'll also prevent other apps from changing records that you've
modified but haven't yet committed or rolled back, but leave
others in the same tables alone. Note that some databases, such
as Access, SQL Server, and Sybase, use page locking, so if one
record is locked, other records near it on the disk may get
locked too. The Idle method may provide partial relief from this.

Quote:
> Qtn1 : What makes a table "in use"? Opening a recordset from that
> table maybe?

If the recordset uses dbDenyWrite, I think so.

Quote:
> Qtn2 : Am I going to be able to use dynaset-Rs to efficiently
> implement multiuser Applications. If not I am very open to
> suggestions for this area or any other areas you feel I should
>  know about.

Transactions seems to provide a good balance of multiuser access
and database consistency, but I always favor data consistency.
Fixing out-of-whack databases pays well, but it's an absolute
nightmare. I'd rather keep my hair and current {*filter*} pressure!

[snip]

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Fri, 03 Sep 1999 03:00:00 GMT  
 Help needed by vbdb new user


[Stuff Clipped]

Quote:
> "Couldn't lock table 'name'; currently in use. (Error 3211)"

>I try to lock the table with the following code:

>  Set rsMyRecordset = dbMydatabase.OpenRecordset(MysqlQuery$, _
> dbOpenDynaset, dbDenyWrite)

This will lock the entire database, in essence it opens the database in
exlusive mode.
It will fail if any other user has the database open with read/write
access, including your own code prior to this open.

Quote:

>..planning on doing the update on "rsMyRecordset"

>Qtn1 : What makes a table "in use"? Opening a recordset from that
>table maybe?

Yes!

Quote:
>Qtn2 : Am I going to be able to use dynaset-Rs to efficiently
>implement multiuser Applications. If not I am very open to
>suggestions for this area or any other areas you feel I should
> know about.

Yes/maybe/perhaps/not sure/depends.
Please be more specific, how many users, number or transactions, type of
access, server or workstation based etc.

Quote:
>Thank you for your time.

>Oguja.

Your welcome!
Cheers,

Robert Porter

http://www.mindspring.com/~rp2c/



Thu, 30 Sep 1999 03:00:00 GMT  
 Help needed by vbdb new user

To lock the database as ready only try opening it the following way

Set dbMydatabase.opendatabase("xxxxx",True,False)

That will do it all.

Quote:


>[Stuff Clipped]
>> "Couldn't lock table 'name'; currently in use. (Error 3211)"

>>I try to lock the table with the following code:

>>  Set rsMyRecordset = dbMydatabase.OpenRecordset(MysqlQuery$, _
>> dbOpenDynaset, dbDenyWrite)

>This will lock the entire database, in essence it opens the database in
>exlusive mode.
>It will fail if any other user has the database open with read/write
>access, including your own code prior to this open.

>>..planning on doing the update on "rsMyRecordset"

>>Qtn1 : What makes a table "in use"? Opening a recordset from that
>>table maybe?

>Yes!

>>Qtn2 : Am I going to be able to use dynaset-Rs to efficiently
>>implement multiuser Applications. If not I am very open to
>>suggestions for this area or any other areas you feel I should
>> know about.

>Yes/maybe/perhaps/not sure/depends.
>Please be more specific, how many users, number or transactions, type of
>access, server or workstation based etc.

>>Thank you for your time.

>>Oguja.

>Your welcome!
>Cheers,

>Robert Porter

>http://www.mindspring.com/~rp2c/



Sun, 03 Oct 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. I need help with a datediff problem ( a fairly new user who needs help)

2. Sequential numbering new records in a VBDB

3. Help needed by new user

4. New User - Need Help

5. New user needs help with attached tables

6. New PB31 user needs help

7. New VB User Needs Help

8. new user needs help

9. New User Needs Help

10. New Visual Dbase User Needs Help

11. HELP NEEDED: CREATING NEW USER

12. New VB user needs a little help

 

 
Powered by phpBB® Forum Software