PDA

View Full Version : EOF or BOF error


zami
12-18-2010, 12:23 PM
Hi again here is the error msg, i m getting, i am selecting informaion from semismain.asp page fields are text , i m getting parameters for report type and report but while i am selection province=0 in both district and tehsil this error is accourd

please help me, here is the code of display page,


ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/rsunew/dbReportDisplay.asp, line 92







<%
'District = Trim(Request("cmbDistrict"))
District = Request.Form("cmbDistrict")
Tehsil = Request.Form("cmbTaluka")

ReportType = Request.Form("cmbReportType")
Report = Request.Form("cmbReport")


Dim RS ' ADO recordset
Dim strDBPath ' path to our Access database (*.mdb) file


Set conn = Server.CreateObject("ADODB.connection")

strDBPath = Server.MapPath("database/SEMISdatabase.mdb")
dim strConnectionString
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
conn.Open strConnectionString
%>


<%

If District = 0 and Tehsil = 0 Then

SQL = "TRANSFORM Count(univ2009.Schoolid) AS CountOfSchoolid SELECT [Code School Level].[Lev-id], [Code School Level].[lev-Type] FROM (univ2009 INNER JOIN [Code School Level] ON univ2009.LevelID = [Code School Level].[Lev-id]) INNER JOIN [Code School Gender] ON univ2009.GenderID = [Code School Gender].[Gend-id] GROUP BY [Code School Level].[Lev-id], [Code School Level].[lev-Type] ORDER BY [Code School Level].[Lev-id], [Code School Gender].[Gend-type] PIVOT [Code School Gender].[Gend-type]"

end if

dim fieldName(5), fieldValue(5)

If District = 0 and Tehsil =0 Then

response.Write("Schools by level and gender Province")

'Field Name
FieldName(0) = rs("Lev-ID") *** Error here
FieldName(1) = rs("Lev-Type")
FieldName(2) = rs("Boys")
FieldName(3) = rs("Girls")
FieldName(4) = rs("Mixed")

end if



if ReportType= 2 and Report= 1 then
response.Write("Schools by status level and gender")

'Field Name
FieldName(0) = rs("Lev-Type")
FieldName(1) = rs("Lev-id")
FieldName(2) = rs("Boys")
FieldName(3) = rs("Girls")
FieldName(4) = rs("Mixed")

end if

if ReportType= 1 and Report= 1 then
SQL = "TRANSFORM Count(univ2009.Schoolid) AS CountOfSchoolid SELECT [Code School Level].[Lev-id], [Code School Level].[lev-Type] FROM (univ2009 INNER JOIN [Code School Level] ON univ2009.LevelID = [Code School Level].[Lev-id]) INNER JOIN [Code School Gender] ON univ2009.GenderID = [Code School Gender].[Gend-id] WHERE (((univ2009.DistrictID)='"&District&"') AND ((univ2009.TehsilID)='"&Tehsil&"')) GROUP BY [Code School Level].[Lev-id], [Code School Level].[lev-Type], univ2009.TehsilID ORDER BY [Code School Level].[Lev-id], [Code School Gender].[Gend-type] PIVOT [Code School Gender].[Gend-type]"

end if

zami
12-18-2010, 07:49 PM
HI
I have done by doing this

if ReportType= 1 and Report= 1 and District <> 0 and Tehsil <> 0 then
thanks all