Hi I am new to ASP and I am trying to build SQL on fly in my page.
sSQL = "SELECT " sSQL = sSQL & " Message1," sSQL = sSQL & " Message2" sSQL = sSQL & " FROM table1" sSQL = sSQL & " WHERE" sSQL = sSQL & " name = '" & customname & "'" Set serverobject = Server.CreateObject("ADODB.Recordset") serverobject .Open sSQL, conn message1 = serverobject ("Message1") message2 = serverobject ("Message2") response.Write message1 response.Write message2 Here whats happening is customname is name entered by user and I am comparing with my name column in table table1.
If it matched then everything is working fine and I am getting proper result.
But if customname doesn't match with name then I am getting this error :
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
What I got to know if I should check for null somehow while calling query and if it contains result then only proceed. Can someone help me how can i achieve this .