Solved

Classic ASP SQL Server error

Posted on 2009-05-13
5
262 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

832 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