Solved

Classic ASP SQL Server error

Posted on 2009-05-13
5
263 Views
Last Modified: 2012-05-06
Error message is Microsoft OLE DB Provider for SQL Server error '80040e21' The requested properties cannot be supported.

I am trying to get this code to run on my new dev environment.  If I comment out lines 4,5 and 6, the code works.  This code does work on the production box.  I have tried updating MDAC.  My sql server driver is version 2000.86.3959.00 which is the same as production.   I can't comment out the lines because there are hundreds of other lines of code similar to this.



Set RSPortalProgrammer = Server.CreateObject("ADODB.Recordset")
RSPortalProgrammer.ActiveConnection = MM_PortalDBConn_STRING
RSPortalProgrammer.Source = "SELECT * FROM tblNames"
RSPortalProgrammer.CursorType = 0
RSPortalProgrammer.CursorLocation = 2
RSPortalProgrammer.LockType = 3
RSPortalProgrammer.Open()

Open in new window

0
Comment
Question by:timothyrmyers
5 Comments
 
LVL 5

Expert Comment

by:Aanvik
ID: 24380951
Try this,
RSPortalProgrammer.CursorLocation = adUseClient
RSPortalProgrammer.CursorType = adOpenStatic
RSPortalProgrammer.LockType = adLockBatchOptimistic

Open in new window

0
 
LVL 10

Accepted Solution

by:
Banthor earned 500 total points
ID: 24380992
Better yet still
Create a sub for all database connections and fix it once.
EXtensibility & Encapsulation
The above code anticipates the enumerations are available, I will attach my Include.
For best performance the values for CursorType and LockType should be dependent the current use.
I only use Read forward only for recordsets on my sites and have excellent performance far better than ASP.NET sites.
RSPortalProgrammer.CursorLocation = 2  ' adUseServer
RSPortalProgrammer.CursorType = 0 'adOpenForwardOnly
RSPortalProgrammer.LockType = 1 'adLockReadOnly

adodb-enumerations.txt
0
 

Author Comment

by:timothyrmyers
ID: 24381139
This is what i got with the first solution:

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
0
 
LVL 10

Expert Comment

by:Banthor
ID: 24381420
The First Solution will work if you Include My attached File.
adodb-enumerations.txt
They convert the Enumerations in the Actual Values.
 
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24384807
This does not make sense.  Those attributes (UseServer, ForwardOnly, ReadOnly) should be the default.  What happens when you try it this way (on a temporary basis for testing purposes only):

Set cn = Server.CreateObject("ADODB.Connection")
cn.ConnectionString = MM_PortalDBConn_STRING
cn.Open
Set RSPortalProgrammer = cn.Execute("SELECT * FROM tblNames")
ResponseWrite "CursorType = " & CStr(RSPortalProgrammer.CursorType) & "<br>"
ResponseWrite "CursorLocation = " & CStr(RSPortalProgrammer.CursorLocation) & "<br>"
ResponseWrite "LockType = " & CStr(RSPortalProgrammer.LockType) & "<br>"
RSPortalProgrammer.Close
cn.Close
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question