<% Dim con str_con = "DRIVER={SQL Server}; SERVER=200.169.88.6; UID=esope; PWD=leoborg_esope; DATABASE=esope;" 'str_con = "provider=microsoft.jet.oledb.4.0; data source =C:\Leonardo\Clientes\iPeso\Aplicativo\db.mdb" Sub db_open Set con = Server.CreateObject("adodb.connection") con.Open str_con End Sub Sub db_close con.Close Set con = Nothing End Sub function db_read(str) if (instr(UCASE(str),UCASE("SELECT")) <> 0) then set rs = Server.CreateObject("ADODB.recordset") rs.CursorLocation = 3 rs.Open str,con if (rs.fields.count = 1 and rs.recordCount = 1) then db_read = rs(0) else set db_read = rs end if else con.execute(str) end if end function function db_scalar(str) set rs_db_scalar = con.execute(str) if (not rs_db_scalar.eof) then db_scalar = rs_db_scalar(0) else db_scalar = "" end if rs_db_scalar.close set rs_db_scalar = nothing end function function db_execute(str) con.execute(str) end function sub db_write(str) if (str <> "") then Response.Write(str) else Response.Write(" ") end if end sub function fcon_deleteData(table, id, param, conn) if ( (table <> "") and (id <> "") and (param <> "") and (conn <> "") ) then conn.execute("delete from " & table & " where " & id & " in (" & param & ")") end if end function sub debug(str) response.write("
"&str&"
") end sub %>