Hi,
When I run the code below I get the error: "Not allowed while object is closed" on the line 'while not rs1.EOF'. If I put 'rs1.open' I get "Not allowed when referencing a bad connection". I have had this once before and it was simply that I had missed the word 'set' from the begining of the line 'rs1 = SearchFNC'.
the code:
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
function doGetFields1()
'This calls the search record DLL searching on the
'value of the input box above.
set SearchDLL = server.CreateObject "prjQandAUpgradeDLLs.clsSearch"
'This IF statement checks to see if the user has
'checked the 'Jobs Completed' tick box
'if they have it uses a different DLL to search for
'jobs that are completed only, otherwise
'it looks up all jobs.
if (Jobs.getChecked()) Then Set SearchFNC = SearchDLL.SearchOnDateInputCompletedJobs(txtValue)
Else
Set SearchFNC = SearchDLL.SearchOnDateInput(txtValue)
End IF
Set rs1 = SearchFNC
strCurrentReferenceNumber = rs1.Fields("RefNumber".Value
Dim MyArray(8) 'First creat an array
'Within this Array we have to build a link to the
'worklogger page passing through
'the reference number, if the user wants all jobs or just
'completed jobs and another
'variable called function which is always set to true.
MyArray(0)="<A HREF='worklogger.asp?RefNo="
MyArray(1)=(rs1("RefNumber")
MyArray(2)="&Jobs="
MyArray(3)=(Jobs.getChecked())
MyArray(4)="&Function=True"
MyArray(5)="'>"
MyArray(6)=(rs1("RefNumber")
MyArray(7)="</A>"
Dim strSentence 'Create a string
strSentence = join (MyArray) 'Join all the array parts into
'the string
Session("RefNoLink" = strSentence 'pass this string into a
'session variable
Dim MyArray1(2)
MyArray1(0)=(rs1("MemberInitials")
MyArray1(1)=(rs1("MemberSurname")
Dim strSentence1
strSentence1 = join (MyArray1)
Session("MemberName" = strSentence1
if IsNull(rs1("DateInput") = False Then Session("DateInput" = rs1("DateInput"
if IsNull(rs1("Client") = False Then Session("Client" = rs1("Client"
if IsNull(rs1("AllocatedTo") = False Then Session("AllocatedTo" = rs1("AllocatedTo"
end function
</SCRIPT>
.
.
.
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<%
'Loop through records adding one row to the table for each record.
while not rs1.EOF
%>
<TR>
<TD WIDTH="50%">Reference Number:</TD>
<!--
Below is the session variable created at the top of the
page this is displayed as a link here. We could have
created the link here but we didn't.
//-->
<TD WIDTH="50%"><%Response.Write(Session("RefNoLink")%></TD>
</TR>
<TR>
<TD WIDTH="50%">Member Name:</TD>
<TD WIDTH="50%"><%Response.Write(Session("MemberName")%></TD>
</TR>
<TR>
<TD WIDTH="50%">Date Input:</TD>
<TD WIDTH="50%"><%Response.Write(Session("DateInput")%></TD>
</TR>
<TR>
<TD WIDTH="50%">Client:</TD>
<TD WIDTH="50%"><%Response.Write(Session("Client")%></TD>
</TR>
<TR>
<TD WIDTH="50%">Allocated To:</TD>
<TD WIDTH="50%"><%Response.Write(Session("AllocatedTo")%></TD>
</TR>
<%
rs1.MoveNext
wend
%>
</TABLE>
Anyone any ideas? "Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway" - Jim Davis (Garfield)
When I run the code below I get the error: "Not allowed while object is closed" on the line 'while not rs1.EOF'. If I put 'rs1.open' I get "Not allowed when referencing a bad connection". I have had this once before and it was simply that I had missed the word 'set' from the begining of the line 'rs1 = SearchFNC'.
the code:
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
function doGetFields1()
'This calls the search record DLL searching on the
'value of the input box above.
set SearchDLL = server.CreateObject "prjQandAUpgradeDLLs.clsSearch"
'This IF statement checks to see if the user has
'checked the 'Jobs Completed' tick box
'if they have it uses a different DLL to search for
'jobs that are completed only, otherwise
'it looks up all jobs.
if (Jobs.getChecked()) Then Set SearchFNC = SearchDLL.SearchOnDateInputCompletedJobs(txtValue)
Else
Set SearchFNC = SearchDLL.SearchOnDateInput(txtValue)
End IF
Set rs1 = SearchFNC
strCurrentReferenceNumber = rs1.Fields("RefNumber".Value
Dim MyArray(8) 'First creat an array
'Within this Array we have to build a link to the
'worklogger page passing through
'the reference number, if the user wants all jobs or just
'completed jobs and another
'variable called function which is always set to true.
MyArray(0)="<A HREF='worklogger.asp?RefNo="
MyArray(1)=(rs1("RefNumber")
MyArray(2)="&Jobs="
MyArray(3)=(Jobs.getChecked())
MyArray(4)="&Function=True"
MyArray(5)="'>"
MyArray(6)=(rs1("RefNumber")
MyArray(7)="</A>"
Dim strSentence 'Create a string
strSentence = join (MyArray) 'Join all the array parts into
'the string
Session("RefNoLink" = strSentence 'pass this string into a
'session variable
Dim MyArray1(2)
MyArray1(0)=(rs1("MemberInitials")
MyArray1(1)=(rs1("MemberSurname")
Dim strSentence1
strSentence1 = join (MyArray1)
Session("MemberName" = strSentence1
if IsNull(rs1("DateInput") = False Then Session("DateInput" = rs1("DateInput"
if IsNull(rs1("Client") = False Then Session("Client" = rs1("Client"
if IsNull(rs1("AllocatedTo") = False Then Session("AllocatedTo" = rs1("AllocatedTo"
end function
</SCRIPT>
.
.
.
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<%
'Loop through records adding one row to the table for each record.
while not rs1.EOF
%>
<TR>
<TD WIDTH="50%">Reference Number:</TD>
<!--
Below is the session variable created at the top of the
page this is displayed as a link here. We could have
created the link here but we didn't.
//-->
<TD WIDTH="50%"><%Response.Write(Session("RefNoLink")%></TD>
</TR>
<TR>
<TD WIDTH="50%">Member Name:</TD>
<TD WIDTH="50%"><%Response.Write(Session("MemberName")%></TD>
</TR>
<TR>
<TD WIDTH="50%">Date Input:</TD>
<TD WIDTH="50%"><%Response.Write(Session("DateInput")%></TD>
</TR>
<TR>
<TD WIDTH="50%">Client:</TD>
<TD WIDTH="50%"><%Response.Write(Session("Client")%></TD>
</TR>
<TR>
<TD WIDTH="50%">Allocated To:</TD>
<TD WIDTH="50%"><%Response.Write(Session("AllocatedTo")%></TD>
</TR>
<%
rs1.MoveNext
wend
%>
</TABLE>
Anyone any ideas? "Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway" - Jim Davis (Garfield)