Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Unwanted cursortype change on Personal Edition

Author  Topic 

hko
Starting Member

8 Posts

Posted - 2001-10-22 : 10:46:51
Hi everyone,

I'm a programmer currently working with VB6 in combination with
SQL Server 2000. I've run into a weird problem that probably is
caused by different default configurations for the different editions
of SQL Server 2000.
Here it is: I programmed some kind of databaselayer in VB for the execution
of queries on the SS database. This layer uses ADO recordsets (v2.6) to
actually retrieve/write data. The problem is that the code I wrote works
perfectly using a connection to the Standard Edition of SS running on
NT Server. But when I copy the code to a local workstation running the
Personal Edition of SS on NT Client and (using SS) I copy the entire
database to this Personal Edition the code fails to run correctly.
I've determined the cause of this error: my execute query function
first states something like:

dim adoResultRS as adodb.recordset

set adoResultRS = new adodb.recordset
adoResultRS.cursorlocation = adUseServer
adoResultRS.cursortype = adOpenKeyset
adoResultRS.locktype = adLockBatchOptimistic

adoResultRS.Open sMyQuery, adoMyConnection

I'm typing this from memory so the syntax may not be perfect but it works correctly on the Standard Edition. Now running this on the Personal Edition causes the adoResultRS recordset to be converted from cursortype = adOpenKeyset to cursortype = adOpenDynamic instantaneously when the adoResultRS.Open command
is executed !
Somehow the Personal Edition automatically changes the cursortype
of my recordset even when it is explicitly set with an acceptable value.
Of course when my application later on refers to the adoResultRS.RecordCount
property it crashes because the value of this property is undefined for
resultsets with cursortype = adOpenDynamic.

Does anyone know what causes this automatic cursortype change and/or how I
can prevent it (i.e. force the Personal Edition to use cursortype = adOpenKeyset) ?
I think it may be the way the PE and SE are configured by default (because I
haven't yet changed any of the settings). Connecting to the personal edition
for another computer using the network results in the same problem so it is not
cause by the application and the PE database server running on the same physical machine.
Help/comment would be very much appreciated, I've done some research on this but could not find anything useful.

Regards,
H. Koffijberg
   

- Advertisement -