Hi everyone,
Has anyone run across anything like this before. I have a basic ADO recordset that works fine with SQL Server 7 but fails with SQL Server 2000. Basically I use this code to retrieve the rs from within a function
FYI rsEditEmp is global
.
.
.
'Get a record set that contains all the data fields in the Employees Table For Editing
sSQL = "Select * From Employees Order By LastName Asc"
If rsEditEmp.State = adStateOpen Then 'Check Record Set State, Close If Needed
rsEditEmp.Close
End If
With rsEditEmp 'Establish Record Set Properties
.ActiveConnection = hDB
.CursorLocation = adUseServer 'Problem with SQL 2000, works with SQL 7
' .CursorLocation = adUseClient 'must use a client cursor with SQL 2000
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open sSQL
End With
rsEditEmp.Close
.
.
.
Then in a later function I attempt to just open the rs with this line of code
.
.
.
rsEditEmp.Open 'changes the cursor type and location
.
.
.
If I step thru the code (with SQL 2000) the cursor type changes when I open the rs to a clientside forward only? Then when I try to do a find I get the error "rowset doesn't support backwards scrolling" because the cursor was changed. As I said it works fine with SQL 7.If I run the clientside cursor with SQL 2000 it works but that is not the cursor I want. Why would Uncle Bill's wonderful improved SQL version change the cursor on just an open statement? Any suggestion? By the way I am using ADO 2.6 with Jet 40 Service Pack 3 and VB6 with Service Pack5. I have tried it on both a NT4 service pack 6a and a Win2k service pack2 machines with the same results. Thanks in advance.![[bugeyed] [bugeyed] [bugeyed]](/data/assets/smilies/bugeyed.gif)
If you choose to battle wits with the witless be prepared to lose.
![[machinegun] [machinegun] [machinegun]](/data/assets/smilies/machinegun.gif)
![[hammer] [hammer] [hammer]](/data/assets/smilies/hammer.gif)
Has anyone run across anything like this before. I have a basic ADO recordset that works fine with SQL Server 7 but fails with SQL Server 2000. Basically I use this code to retrieve the rs from within a function
FYI rsEditEmp is global
.
.
.
'Get a record set that contains all the data fields in the Employees Table For Editing
sSQL = "Select * From Employees Order By LastName Asc"
If rsEditEmp.State = adStateOpen Then 'Check Record Set State, Close If Needed
rsEditEmp.Close
End If
With rsEditEmp 'Establish Record Set Properties
.ActiveConnection = hDB
.CursorLocation = adUseServer 'Problem with SQL 2000, works with SQL 7
' .CursorLocation = adUseClient 'must use a client cursor with SQL 2000
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open sSQL
End With
rsEditEmp.Close
.
.
.
Then in a later function I attempt to just open the rs with this line of code
.
.
.
rsEditEmp.Open 'changes the cursor type and location
.
.
.
If I step thru the code (with SQL 2000) the cursor type changes when I open the rs to a clientside forward only? Then when I try to do a find I get the error "rowset doesn't support backwards scrolling" because the cursor was changed. As I said it works fine with SQL 7.If I run the clientside cursor with SQL 2000 it works but that is not the cursor I want. Why would Uncle Bill's wonderful improved SQL version change the cursor on just an open statement? Any suggestion? By the way I am using ADO 2.6 with Jet 40 Service Pack 3 and VB6 with Service Pack5. I have tried it on both a NT4 service pack 6a and a Win2k service pack2 machines with the same results. Thanks in advance.
![[bugeyed] [bugeyed] [bugeyed]](/data/assets/smilies/bugeyed.gif)
If you choose to battle wits with the witless be prepared to lose.
![[machinegun] [machinegun] [machinegun]](/data/assets/smilies/machinegun.gif)
![[hammer] [hammer] [hammer]](/data/assets/smilies/hammer.gif)