kindly chk guys...
function return
case: table Billings has no records and yet the function return BILL EXIST (response.write("bill exist") that supposedly return "CREATE NEW BILL.... any idea saon pag fix? ty..
<%
option explicit
dim strBillingperiod, strPeriodCovered, _
conBill, rsChkBill, strChkBillQuery
strBillingperiod= Request.Form("cboBillingPeriod")
strperiodcovered= Request.Form("cboPeriodCovered")
'if Trim(strBillingperiod) = "" OR Trim(strperiodcovered) = "" Then _
'Response.Write("error") 'Response.Redirect("Loginfailureform.asp")
set conbill = Server.CreateObject("ADODB.Connection")
conbill.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db/IAccnt.mdb")
if isvalidbilling(strBillingperiod,strPeriodCovered) =true then Response.Write("Create New Bill") else Response.Write("bil exist")
'some codes here...
function isvalidbilling(byval argBillPeriod, byval argPeriodCover)
isvalidbilling=false
strChkBillQuery = "SELECT BillingPeriod, periodcover FROM Billings WHERE billingperiod='" & argBillPeriod & "' AND periodcover ='" & argPeriodCover & "'"
Set rsChkBill = conBill.Execute(strChkBillQuery)
if rsChkBill.bof=false and rschkbill.eof=false then isvalidbilling=true
rsChkBill.close:set rsChkBill=nothing
end function
%>