lawrance4
asked on
Variable is undefined: 'adOpenKeyset'
I'm not a programmer, so please bear with me. My buddy wrote the page, and I can usually go in and figure out many of my issues, but I honestly don't know what "adOpenKeyset" is, or if it's even necessary on this page. I tried deleting it, trying other "adOpen" commands, but nothing worked.
I'm not sure what happened. This page has been working fine for a year or two, and suddenly it decided to break. Is there a chance my hosting server made a change that broke this?
The error is as stated in the title: Variable is undefined: 'adOpenKeyset'
Here is a copy of the first portion of the code:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
'------------------------- ---------- ---------- ---------- ---------- ---------- ----
' Author: LM
' Create Date: 12/22/2002
' Page Function: This page previews an ad from the database
'------------------------- ---------- ---------- ---------- ---------- ---------- ----
Dim dcnDB ' As ADODB.Connection
Dim strDatabaseLocation ' As String
Dim rsQuery ' As ADODB.Connection
Dim strMESSAGE ' As String
Dim strNAME ' As String
Dim rsORDER ' As ADODB.Recordset
Dim strORDER ' As String
Dim strEMAIL ' As String
strNAME = Request.Form("CName")
%>
<!--#INCLUDE FILE="includes/ConnectData base1.inc" -->
<%
Set rsQuery = Server.CreateObject("ADODB .Recordset ")
rsQuery.Open "SELECT * FROM ads", dcnDB, adOpenKeyset, adLockOptimistic
'------------------------- ---------- ---------- ---------- ---------- ---------- ----
' Defines session values
'------------------------- ---------- ---------- ---------- ---------- ---------- ----
SessionValues
'------------------------- ---------- ---------- ---------- ---------- ---------- ----
' Checks to make sure required fields filled out
'------------------------- ---------- ---------- ---------- ---------- ---------- ----
CheckForm1
%>
<HTML>
I'm not sure what happened. This page has been working fine for a year or two, and suddenly it decided to break. Is there a chance my hosting server made a change that broke this?
The error is as stated in the title: Variable is undefined: 'adOpenKeyset'
Here is a copy of the first portion of the code:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
'-------------------------
' Author: LM
' Create Date: 12/22/2002
' Page Function: This page previews an ad from the database
'-------------------------
Dim dcnDB ' As ADODB.Connection
Dim strDatabaseLocation ' As String
Dim rsQuery ' As ADODB.Connection
Dim strMESSAGE ' As String
Dim strNAME ' As String
Dim rsORDER ' As ADODB.Recordset
Dim strORDER ' As String
Dim strEMAIL ' As String
strNAME = Request.Form("CName")
%>
<!--#INCLUDE FILE="includes/ConnectData
<%
Set rsQuery = Server.CreateObject("ADODB
rsQuery.Open "SELECT * FROM ads", dcnDB, adOpenKeyset, adLockOptimistic
'-------------------------
' Defines session values
'-------------------------
SessionValues
'-------------------------
' Checks to make sure required fields filled out
'-------------------------
CheckForm1
%>
<HTML>
ASKER
I tried your suggestion and got this:
Variable is undefined: 'adLockOptimistic'
I haven't changed my include file either, but here is what the "ConnectDatabase1.inc" file contains:
<%
strDatabaseLocation = "D:\Websites\www.fsbo-indy.com\database\fsboindy.mdb"
Set dcnDB = Server.CreateObject("ADODB .Connectio n")
dcnDB.ConnectionString = _
"Provider=Microsoft.Jet.OL EDB.4.0;" _
& "Persist Security Info=False;Data Source=" _
& strDatabaseLocation
dcnDB.Open
%>
Variable is undefined: 'adLockOptimistic'
I haven't changed my include file either, but here is what the "ConnectDatabase1.inc" file contains:
<%
strDatabaseLocation = "D:\Websites\www.fsbo-indy.com\database\fsboindy.mdb"
Set dcnDB = Server.CreateObject("ADODB
dcnDB.ConnectionString = _
"Provider=Microsoft.Jet.OL
& "Persist Security Info=False;Data Source=" _
& strDatabaseLocation
dcnDB.Open
%>
Thinking about it, it wouldn't be defined in your include file at all (sorry, I don't use ASP all that much). It is very possible that your host has made some changes which has caused your code to stop working.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For reference, it is equal to 1, so you might try this:
rsQuery.Open "SELECT * FROM ads", dcnDB, 1, adLockOptimistic