|
-
Apr 13th, 2006, 10:54 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED]Question about rs.CursorLocation = adUseClient
The answer to my last problem with the datagrid not populating was that i needed to add rs.CursorLocation = adUseClient code before the rs.Open code.
Example:
rs.CursorLocation = adUseClient
rs.Open "tblEmployee", cn, adOpenKeyset, adLockPessimistic, adCmdTable
However, I do not want to be a programmer who Copies and Pastes and says it works because it's MAGIC!!!
Why did it only populate my datagrid after I added the code rs.CursorLocation = adUseClient? What's the purpose of this code and I basically want the 411 about this code. Any information on how this code works and why it works will be helpful since I'm currently in the state of .
Last edited by lilmark; Apr 14th, 2006 at 12:22 AM.
-
Apr 13th, 2006, 01:11 PM
#2
Re: Question about rs.CursorLocation = adUseClient
Basically there are two cursor locations, Client Side and Server Side.
Client Side is a service maintained by ADO. The functionality it supports is the same no matter which provider/database you are using. Client Side only supports a Static Cursor (adOpenStatic), which means all records are transferred and loaded into the memory of the computer which executed the query. It does not support Pessimistic locking.
Server Side is a service maintained by the Provider. The functionality it supports depends on the provider/database. It uses the memory resources of the server where the database is located. Jet is not a "Server" like Oracle or SQL Server so it always uses the resources of the client computer, even if the database is located on a network server.
In you sample code, the adOpenKeyset and adLockPessimistic are ignored because they are not supported by a Client Side cursor. You will get a adOpenStatic cursor it will use adLockBatchOptimistic locking.
-
Apr 13th, 2006, 03:32 PM
#3
Thread Starter
Hyperactive Member
Re: Question about rs.CursorLocation = adUseClient
If adUseClient does not support adOpenKeyset or adLock Pessimistic what should I use instead?
And, if adUseClient only supports adOpenStatic where all records are transferred and loaded onto the computer executing the program does that not set a security risk if any given user using the program will have all the records from the database loaded onto their PC?
I apologize ahead of time if what I say makes no sense at all. I am new to the whole VB with databases.
Last edited by lilmark; Apr 13th, 2006 at 04:16 PM.
-
Apr 13th, 2006, 09:26 PM
#4
Re: Question about rs.CursorLocation = adUseClient
 Originally Posted by lilmark
If adUseClient does not support adOpenKeyset or adLock Pessimistic what should I use instead?
As Bruce said, it doesn't matter what you put there - it'll be ignored, since you aren't given a choice.
And, if adUseClient only supports adOpenStatic where all records are transferred and loaded onto the computer executing the program does that not set a security risk if any given user using the program will have all the records from the database loaded onto their PC?
It's loaded into the memory your program is using (unless you save it to disk or print it out), so it's as safe as any other computer data.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|