adUseServer Constant Undefined

W

Wayne Wengert

I have an ASP page in which I reference quite a few ADO constants such as
adOpenStatic, adLockReadOnly and they work fine but a reference to
adUseServer comes up as undefined?

I have a typelib definition in that page:

<!--METADATA TYPE="typelib" uuid="00000205-0000-0010-8000-00AA006D2EA4" -->

For the time being I used the constant 2 to replace that reference - I hope
that is correct?

Any ideas on why that constant remains undefined?
 
C

Curt_C [MVP]

do an INCLUDE of the adovbs.inc file


--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------


Wayne Wengert said:
I have an ASP page in which I reference quite a few ADO constants such as
adOpenStatic, adLockReadOnly and they work fine but a reference to
adUseServer comes up as undefined?

I have a typelib definition in that page:

<!--METADATA TYPE="typelib"
uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
 
D

dlbjr

If Using Stored Procs:

Try to add SET NOCOUNT ON as a very first statement inside each SP.
It may fix your problem with returning result and improve performance as
well.
 
W

Wayne Wengert

But that is what the typelib reference is supposed to take care of isn't it?
All the other constants work?

Wayne
 
B

Bob Barrows

Wayne said:
But that is what the typelib reference is supposed to take care of
isn't it? All the other constants work?
This usually means you referenced the wrong version of the type library. See
here for the version-specific references:
http://www.aspfaq.com/show.asp?id=2112

You can determine the ADO version by checking the Version property of the
connection object.

HTH,
Bob Barrows
 
M

MSFT

Hi Wayne,

What is the version of MDAC installed on your computer? I have MDAC 2.8
installed, and following code seems to work:

<%@ Language=VBScript %>

<!--METADATA TYPE="typelib" uuid="00000205-0000-0010-8000-00AA006D2EA4" -->

<html>
<head>
<title>Test Page</title>

</head>
<body >

<%



dim re

set re=server.CreateObject("adodb.recordset")

re.CursorLocation = adUseServer

re.CursorType =adOpenStatic

%>


</body>
</html>

By the way, you are right that the value for adUseServer is 2.

Luke
Microsoft Online Partner Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top