I tried what Rudy told me to, but it seems I still get errors. Here is the source code: sql_query = "SELECT * from tblrawdata where (p1 p2 p3) and p4 and p5 order by instrument,timestamp" sql_view = "create view Dayview (theday,value,instrument) as select convert(char(10),timestamp,102),value,instrument from tblrawdata where (p1 p2 p3) and p4 and p5" > p1,p2,p3,p4,p5 are parameters. Ignore them Main part of the source code: <% Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open "FILEDSN=c:\inetpub\dbs\deyai.dsn;uid=sa;pwd=deyai" MyConn.Execute (drop) Set RS = MyConn.Execute(SQL_query) Set VRS = MyConn.Execute(SQL_view) Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open "FILEDSN=c:\inetpub\dbs\deyai.dsn;uid=sa;pwd=deyai" sql37="select avg(value) as a37 from Dayview where instrument=37 group by theday" Set RS37 = MyConn.Execute(sql37) avg_37=rs37("a37") sql38="select sum(value) as s38 from Dayview where instrument=38 group by theday" Set Rs38 = MyConn.Execute(sql38) sum_38=rs38("s38") sql43="select sum(value) as s43 from Dayview where instrument=43 group by theday" Set Rs43 = MyConn.Execute(sql43) sum_43=rs43("s43") Set RS = MyConn.Execute(SQL_query) Set VRS = MyConn.Execute(SQL_view) %> I get the following error: ADODB.Field error '800a0bcd' Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record. at line "Set Rs38=..." Does anyone have a clue of what this error is, and what I have done wrong? Thanks, Marios _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.