Solved

Classic ASP SQL Server error

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now