From: jorgeaccinelli on
On 20 abr, 12:54, Lars Broberg <this.is.not.a.va...(a)dress.se> wrote:
> Jorge,
>  >    Finally ...
>  >    MY RECORDET is in read-only mode, but another
>  >    user can take the same recorset in mode
>  >    Read- write and change things? When I update the
>  >    Database should I take precautions
>  >    If this has happened? I guess the answer,
>  >    But I am planning to move from DBF to Sql
>  >    I would like to know your opinion
>  >   Thanks
> Well, there are no locks held and no "connection" to the database (if
> you have a clientside cursor) so you have no idea what's happening there
> <g>.
> But the locking strategies in SQL really isn't any different from DBF,
> but you have the option to do the updates/inserts/deletes in a couple of
> different ways:
> - Via ADO (obviously not with ReadOnly recordsets)
> - Via your own "UPDATE/DELETE/INSERT" code executing via AdoCommand
> - Via your own Stored Procedures (for UPDATE/DELETE/INSERT)
> In the first case ADO can handle the lockings if you have a primary key
> in the table and you use for example adLockOptimistic. I wouldn't use
> this other than for very simple updates on simple tables.
> In the two other cases you have to have some way of "knowing" if some
> other user have changed the record before "you". The term "record" here
> can mean information from more than one table. You normally use datetime
> fields for this or the SQL Server Timestamp data type.
> Some info about the Timestamp data type:http://msdn2.microsoft.com/en-us/library/ms182776.aspx
> Hope this helps in some way...
> ----
> Lars Broberg
> Elbe-Data AB
> lars at elbe-data dot se

Thank you, the answer is very useful
Jorge
From: Rob van Erk on
Erik, Willie,

Thanks for your comments on the subject. Removing the ..close() solved
the issue but also changed my code and used the SetRecordSet instead.
All clear.

Geoff,

Frankly speaking I have to learn much more on SQL. I succeed now to
insert, delete and update records and that is for me a big step
forward. Same story for the "why do you use the forward cursor" remark
you made. The background and usage of a "cursor" was explained in one
of the previous messages but not yet sure when to use what. Anyhow,
thanks for the info.

Brgds,
Rob
From: Geoff Schaller on
Rob,

Like all things, you need to look them up and you should not be relying
on this forum for such fundamental answers to SQL matters. If you want
to learn about cursors and you don't get enough out of the book on your
desk then look it up in Books On Line (BOL) for SQL Server. They are
very good.

Search on cursor and you will get several pages explaining all the types
of cursors and even when to use them.

After BOL you need google. Again, type cursor <enter> and a wealth of
definitions and discussions arise. The kinds of questions you are asking
indicate that you need to know more about the fundamentals of SQL first
because you aren't really asking the right questions. As a result you
only get half-answers in a forum like this one.

SQL has come a long way in 5 years and will offer you things DBF just
cannot imagine. But it also comes with issues of its own and if you
don't understand these, they will bring you undone very quickly. Or best
case, you will never achieve what SQL offers.

Read up on SQL first and get to understand the DBMS engine. Then ask the
questions <g>.

Geoff



"Rob van Erk" <erk.v(a)hotmail.com> wrote in message
news:c38a57ae-60e2-4aa5-91c1-b388cc5e320c(a)l64g2000hse.googlegroups.com:

> Erik, Willie,
>
> Thanks for your comments on the subject. Removing the ..close() solved
> the issue but also changed my code and used the SetRecordSet instead.
> All clear.
>
> Geoff,
>
> Frankly speaking I have to learn much more on SQL. I succeed now to
> insert, delete and update records and that is for me a big step
> forward. Same story for the "why do you use the forward cursor" remark
> you made. The background and usage of a "cursor" was explained in one
> of the previous messages but not yet sure when to use what. Anyhow,
> thanks for the info.
>
> Brgds,
> Rob

From: Rob van Erk on
Geoff,

Will have a look at BOL. Some months ago I purchased two dutch SQL
books and basically I already made a lot of progression understanding
the SQL logic (including DBMS). My app runs fine with information
gathered from these books but in practise you will always find new
challenges like the "cursor" thing. Will study further but as
programmer you always like to practise/play in your
applications too...

Rob
From: Geoff Schaller on
Sure... and cursors can be your 'curse' <g>.

Mostly, for VO style uses (particularly browsers), client side static
cursors are the go. But forward only, server side read only cursors can
be very fast for lookups. The degree of locking can have a huge impact
on performance. It all matters so it is all quite relevant.

Geoff



"Rob van Erk" <erk.v(a)hotmail.com> wrote in message
news:800f9edd-a459-449c-92fb-348867cc88fa(a)b1g2000hsg.googlegroups.com:

> Geoff,
>
> Will have a look at BOL. Some months ago I purchased two dutch SQL
> books and basically I already made a lot of progression understanding
> the SQL logic (including DBMS). My app runs fine with information
> gathered from these books but in practise you will always find new
> challenges like the "cursor" thing. Will study further but as
> programmer you always like to practise/play in your
> applications too...
>
> Rob

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Date converting
Next: bBrowser and combobox