%
function fselect(db,query)
dim rs,con
Set Con = Server.CreateObject("ADODB.Connection")
con.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("/mdb-database/product.mdb")
'Dim Con, sConnString
'Set Con = Server.CreateObject("ADODB.Connection")
'sConnString = "Provider = Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & Server.Mappath("../fpaoloprova/product.mdb")
'Con.Open(sConnString)
'set con=server.createObject("adodb.connection")
'con.open db
set rs=server.createObject("adodb.recordset")
rs.CursorLocation= 3 ' adUseClient
rs.open query,con
set fselect=rs
set rs.activeconnection=nothing
set fselect=rs
con.close
set con=nothing
end function
'--------------------------------------
sub showProductDetails(id)
dim rs
dim nomearr
set rs=fselect(Application("Product"),"select * from items where id=" & id)
while not rs.eof
if rs.bof then break
response.write "
"
response.write nomearr
rs.moveNext
wend
rs.close
set rs=nothing
end sub
'------------------------------------------
sub showProductCount(idp)
dim rs
set rs=fselect(Application("Product"),"select count1 from basket where idp=" & idp & " and ids='" & Session.SessionID & "'" )
while not rs.eof
if rs.bof then break
response.write "
"
rs.moveNext
wend
rs.close
set rs=nothing
end sub
'------------------------------------------
sub showTotalCost()
dim total,rs,rs1,totpunto,totale
total=0
set rs=fselect(Application("Product"),"select items.price,basket.count1 from basket,items where ids='" & Session.SessionID & "' and idp=items.id" )
while not rs.eof
if rs.bof then break
total=total+rs(0)*rs(1)
rs.moveNext
wend
rs.close
set rs=nothing
response.write total
end sub
%>
<%
if count>0 then
%>
<%
sub ciao()
dim total,rs,rs1, totale, totpunto
total=0
set rs=fselect(Application("Product"),"select items.price,basket.count1 from basket,items where ids='" & Session.SessionID & "' and idp=items.id" )
while not rs.eof
if rs.bof then break
total=total+rs(0)*rs(1)
rs.moveNext
wend
rs.close
set rs=nothing
totpunto = total
totale = replace(totpunto,",",".")
response.Write(totale)
end sub
%>