ADODB.Connection error '800a0e79' Operation is not allowed when the object is open.
/cosearchlist.asp, line 270
Code is as follows:
If fNeedRecordset Then
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = Session("DataConn_ConnectionTimeout")
DataConn.CommandTimeout = Session("DataConn_CommandTimeout")
not enough code here to tell u. also, which line is 270?
trelynda
02-12-2007, 06:18 PM
It won't let me paster the whole code and I am not sure if I only paste part that it wont confuse the issue.
russell
02-12-2007, 09:49 PM
well, if u still need help, paste more code. no one can answer based on what you've shown so far. also, paste it betwen code tags
[ code]
Code Here
[ /code]
but remove the space between "[" and "code" and "/code]"
Terrorke
02-13-2007, 02:07 AM
Maybe I'm wrong but is your access database still opened when you run the script?
trelynda
02-13-2007, 09:06 AM
That error was created when I tried to use a DSN-less connection. When I use the DSN, I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xb690 Thread 0x8248 DBC 0x10b4094 Jet'.
/cosearchlist.asp, line 267
Attached is the code part one:
<%@ LANGUAGE="VBScript" %>
<%
'-------------------------------------------------------------------------------
' Microsoft Visual InterDev - Data Form Wizard
'
' List Page
'
' (c) 1997 Microsoft Corporation. All Rights Reserved.
'
' This file is an Active Server Page that contains the list view of a Data Form.
' It requires Microsoft Internet Information Server 3.0 and can be displayed
' using any browser that supports tables. You can edit this file to further
' customize the list view.
'
'-------------------------------------------------------------------------------
Dim strPagingMove
Dim strDFName
strDFName = "rscosearchSQLQuery"
%>
'-------------------------------------------------------------------------------
' Purpose: Substitutes Empty for Null and trims leading/trailing spaces
' Inputs: varTemp - the target value
' Returns: The processed value
'-------------------------------------------------------------------------------
Function ConvertNull(varTemp)
If IsNull(varTemp) Then
ConvertNull = ""
Else
ConvertNull = Trim(varTemp)
End If
End Function
'-------------------------------------------------------------------------------
' Purpose: Embeds bracketing quotes around the string
' Inputs: varTemp - the target value
' Returns: The processed value
'-------------------------------------------------------------------------------
Function QuotedString(varTemp)
If IsNull(varTemp) Then
QuotedString = Chr(34) & Chr(34)
Else
QuotedString = Chr(34) & CStr(varTemp) & Chr(34)
End If
End Function
'-------------------------------------------------------------------------------
' Purpose: Tests string to see if it is a URL by looking for protocol
' Inputs: varTemp - the target value
' Returns: True - if is URL, False if not
'-------------------------------------------------------------------------------
Function IsURL(varTemp)
IsURL = True
If UCase(Left(Trim(varTemp), 6)) = "HTTP:/" Then Exit Function
If UCase(Left(Trim(varTemp), 6)) = "FILE:/" Then Exit Function
If UCase(Left(Trim(varTemp), 8)) = "MAILTO:/" Then Exit Function
If UCase(Left(Trim(varTemp), 5)) = "FTP:/" Then Exit Function
If UCase(Left(Trim(varTemp), 8)) = "GOPHER:/" Then Exit Function
If UCase(Left(Trim(varTemp), 6)) = "NEWS:/" Then Exit Function
If UCase(Left(Trim(varTemp), 7)) = "HTTPS:/" Then Exit Function
If UCase(Left(Trim(varTemp), 8)) = "TELNET:/" Then Exit Function
If UCase(Left(Trim(varTemp), 6)) = "NNTP:/" Then Exit Function
IsURL = False
End Function
'-------------------------------------------------------------------------------
' Purpose: Handles the display of a field from a recordset depending
' on its data type, attributes, and the current mode.
' Assumes: That the recordset containing the field is open
' Inputs: strFieldName - the name of the field in the recordset
' avarLookup - array of lookup values
'-------------------------------------------------------------------------------
Function ShowField(strFieldName, avarLookup)
Dim intRow
Dim strPartial
Dim strBool
Dim nPos
strFieldValue = ""
nPos=Instr(strFieldName,".")
Do While nPos > 0
strFieldName= Mid (strFieldName, nPos+1)
nPos=Instr(strFieldName,".")
Loop
If Not IsNull(avarLookup) Then
Response.Write "<TD BGCOLOR=White NOWRAP><FONT SIZE=-1>"
For intRow = 0 to UBound(avarLookup, 2)
If ConvertNull(avarLookup(0, intRow)) = ConvertNull(rscosearchSQLQuery(strFieldName)) Then
Response.Write Server.HTMLEncode(ConvertNull(avarLookup(1, intRow)))
Exit For
End If
Next
Response.Write "</FONT></TD>"
Exit Function
End If
Select Case rscosearchSQLQuery(strFieldName).Type
Case adBoolean, adUnsignedTinyInt 'Boolean
strBool = ""
If rscosearchSQLQuery(strFieldName) <> 0 Then
strBool = "True"
Else
strBool = "False"
End If
Response.Write "<TD BGCOLOR=White ><FONT SIZE=-1>" & strBool & "</FONT></TD>"
Case adBinary, adVarBinary, adLongVarBinary 'Binary
Response.Write "<TD BGCOLOR=White ><FONT SIZE=-1>[Binary]</FONT></TD>"
Case adLongVarChar, adLongVarWChar 'Memo
Response.Write "<TD BGCOLOR=White NOWRAP><FONT SIZE=-1>"
strPartial = Left(rscosearchSQLQuery(strFieldName), 50)
If ConvertNull(strPartial) = "" Then
Response.Write " "
Else
Response.Write Server.HTMLEncode(strPartial)
End If
If rscosearchSQLQuery(strFieldName).ActualSize > 50 Then Response.Write "..."
Response.Write "</FONT></TD>"
Case Else
Response.Write "<TD BGCOLOR=White ALIGN=Left NOWRAP><FONT SIZE=-1>"
If ConvertNull(rscosearchSQLQuery(strFieldName)) = "" Then
Response.Write " "
Else
' Check for special field types
Select Case UCase(Left(rscosearchSQLQuery(strFieldName).Name, 4))
Case "URL_"
Response.Write "<A HREF=" & QuotedString(rscosearchSQLQuery(strFieldName)) & ">"
Response.Write Server.HTMLEncode(ConvertNull(rscosearchSQLQuery(strFieldName)))
Response.Write "</A>"
Case Else
If IsURL(rscosearchSQLQuery(strFieldName)) Then
Response.Write "<A HREF=" & QuotedString(rscosearchSQLQuery(strFieldName)) & ">"
Response.Write Server.HTMLEncode(ConvertNull(rscosearchSQLQuery(strFieldName)))
Response.Write "</A>"
Else
Response.Write Server.HTMLEncode(ConvertNull(rscosearchSQLQuery(strFieldName)))
End If
End Select
End If
Response.Write "</FONT></TD>"
End Select
End Function
If IsEmpty(Session("rscosearchSQLQuery_Recordset")) Then
fNeedRecordset = True
Else
If Session("rscosearchSQLQuery_Recordset") Is Nothing Then
fNeedRecordset = True
Else
Set rscosearchSQLQuery = Session("rscosearchSQLQuery_Recordset")
End If
End If
If fNeedRecordset Then
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = Session("DataConn_ConnectionTimeout")
DataConn.CommandTimeout = Session("DataConn_CommandTimeout")
'DataConn.Provider="Microsoft.Jet.OLEDB.4.0;User ID=;Password=;Data Source=WWWentry" & server.mappath(("/gabc1.mdb")
DataConn.Open Session("DataConn_ConnectionString"), Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set rscosearchSQLQuery = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "SELECT Companies.conum, Companies.Date, Companies.Name, Companies.State, Companies.MDStdComp, Companies.Rider1, Companies.Rider2, Companies.Rider3, Companies.Lifeins, Companies.GABCDental, Companies.GABCVision, Companies.CDCDental, Companies.MDMedExp, Companies.MDCompMed, Companies.VAComp, Companies.VAMedical, Companies.ShortDis, Companies.KirbyMed, Companies.MDStdPlus, Companies.Gold, Companies.Silver, Companies.Bronze FROM Companies WHERE Companies.conum =" + userqu
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = DataConn
rscosearchSQLQuery.Open cmdTemp, , 1, 3
End If
On Error Resume Next
If rscosearchSQLQuery.BOF And rscosearchSQLQuery.EOF Then fEmptyRecordset = True
On Error Goto 0
If Err Then fEmptyRecordset = True
If fNeedRecordset Then
Set Session("rscosearchSQLQuery_Recordset") = rscosearchSQLQuery
Else
rscosearchSQLQuery.MoveFirst
End If
If Not IsEmpty(Session("rscosearchSQLQuery_Filter")) And Not fEmptyRecordset Then
rscosearchSQLQuery.Filter = Session("rscosearchSQLQuery_Filter")
If rscosearchSQLQuery.BOF And rscosearchSQLQuery.EOF Then fEmptyRecordset = True
End If
If fEmptyRecordset Then
fHideNavBar = True
fHideRule = True
End If
Do
If fEmptyRecordset Then Exit Do
If Not fFirstPass Then
rscosearchSQLQuery.MoveNext
Else
fFirstPass = False
End If
If rscosearchSQLQuery.EOF Then Exit Do
%>
<!--METADATA TYPE="DesignerControl" endspan-->
<TR VALIGN=TOP>
<TD BGCOLOR=White><FONT SIZE=-1>
<% tCurRec = ((Session("rscosearchSQLQuery_AbsolutePage") - 1) * tPageSize) + tRecordsProcessed %>
<%= tCurRec %></FONT></TD>
</FONT></TD>
<%
ShowField "conum", Null
ShowField "Name", Null
ShowField "Date", Null
ShowField "State", Null
fHideRule = True
%>
</TR> </TABLE><BR>Please Select an offering below for more details<BR>
<% If rscosearchSQLQuery("MDStdComp") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/md_standard_comp.htm"><B>Maryland Standard Plan</B><BR></A> <%else Response.Write " " End If %>
<% If rscosearchSQLQuery("Rider1") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/md_standard_comp.htm"><B>Maryland Standard Plan Rider1</B><BR></A> <%else Response.Write " " End If %>
<% If rscosearchSQLQuery("Rider2") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/md_stnadard_comp.htm"><B>Maryland Standard Plan Rider2</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("Rider3") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/md_standard_comp.htm"><B>Maryland Standard Plan Rider3</B><BR></A> <%else Response.Write " " End If %>
<% If rscosearchSQLQuery("Lifeins") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/ad_d/ad_d.htm"><B>Life and AD&D Insurance</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("GABCDental") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/dental_1__gabc_.htm"><B>GABCDental</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("GABCVision") <> 0 Then %><A HREF="http://www.gabchealth.org/newplans/gabc_vision.htm"><B>GABCVision</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("CDCDental") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/dental_2_cdc_.htm"><B>CDCDental</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("MDMedExp") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/md_medical_expense.htm"><B>MD Medical Expense</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("MDCompMed") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/md_comp_medical.htm"><B>MD Comprehensive</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("VAComp") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/va_comp.htm"><B>VA Comprehensive</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("VAMedical") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/va-medical.htm"><B>VA Medical</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("ShortDis") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/short_term_disability.htm"><B>Short Term Disability</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("KirbyMed") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/kirby_med.htm"><B>Kirby Medical</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("MDStdPlus") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/md_standard_plus.htm"><B>Maryland Standard Plus all Three Riders</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("Gold") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/gold.htm"><B>Gold</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("Silver") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/silver.htm"><B>Silver</B><BR></A> <% else Response.Write " " End If %>
<% If rscosearchSQLQuery("Bronze") <> 0 Then %> <A HREF="http://www.gabchealth.org/newplans/bronze.htm"><B>Gold</B><BR></A> <% else Response.Write " " End If %>
<BR>
<BR>
<BR>
<BR>
<A HREF="http://www.gabchealth.org">Return Home</A>
<!--METADATA TYPE="DesignerControl" startspan
<OBJECT ID="DataRangeFtr1" WIDTH=151 HEIGHT=24
CLASSID="CLSID:F602E722-A281-11CF-A5B7-0080C73AAC7E">
</OBJECT>
-->
<%
Loop
If tRangeType = "Table" Then Response.Write "</TABLE>"
If tPageSize > 0 Then
If Not fHideRule Then Response.Write "<HR>"
If Not fHideNavBar Then
%>
<TABLE WIDTH=100% >
<TR>
<TD WIDTH=100% >
<P ALIGN=<%= tBarAlignment %> >
<FORM <%= "ACTION=""" & Request.ServerVariables("PATH_INFO") & stQueryString & """" %> METHOD="POST">
<INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE=" << ">
<INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE=" < ">
<INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE=" > ">
<% If fSupportsBookmarks Then %>
<INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE=" >> ">
<% End If %>
<% If Not fHideRequery Then %>
<INPUT TYPE="Submit" NAME="<% =tHeaderName & "_PagingMove" %>" VALUE=" Requery ">
<% End If %>
</FORM>
</P>
</TD>
<TD VALIGN=MIDDLE ALIGN=RIGHT>
<FONT SIZE=2>
<%
If Not fHideNumber Then
If tPageSize > 1 Then
Response.Write "<NOBR>Page: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
Else
Response.Write "<NOBR>Record: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
End If
End If
%>
</FONT>
</TD>
</TR>
</TABLE>
<%
End If
End If
%>
<!--METADATA TYPE="DesignerControl" endspan-->
<%
' TEMP: cache here until CacheRecordset property is implemented in
' data range
If fNeedRecordset Then
Set Session("rscosearchSQLQuery_Recordset") = rscosearchSQLQuery
End If
%>
</TD></TR></TABLE>
</BODY>
</HTML>
Terrorke
02-13-2007, 10:31 AM
Here are some articles I found on the errormessage :
I am at a loss to why I cannot get access to the database. I spoke to the customer service people today and they gave me a different path to use but not it is just saying, page not found!
trelynda
02-14-2007, 03:07 PM
Latest comment from my web support:check your global.asa file, you have an unterminated string constant. HELP!
Here is the code:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
'You can add special event handlers in this file that will get run automatically when special Active Server Pages events
'occur. To create these handlers, just create a subroutine with a name from the list below that corresponds to the event
'you want to use. For example, to create an event handler for Session_OnStart, you would put the following code into this
'file (without the comments):
'Sub Session_OnStart
'**Put your code here **
'End Sub
'EventName Description
'Session_OnStart Runs the first time a user runs any page in your application
'Session_OnEnd Runs when a user's session times out or quits your application
'Application_OnStart Runs once when the first page of your application is run for the first time by any user
'Application_OnEnd Runs once when the web server shuts down