<% Function Formata(n, totalDigits) Formata = Right(String(totalDigits,"0") & n, totalDigits) End Function if Session("LOGADO") <> "T" then Response.Redirect "index.asp" if inStr(Request.ServerVariables("HTTP_HOST"), "localhost") > 0 then sPath = Server.MapPath("unidade.mdb") : sPathOco = Server.MapPath("db1.mdb") else aVar = Split(Request.ServerVariables("SCRIPT_NAME"), "/") 'pega o padrao www.dominio.com.br/ativas/nomePastaEscola sEscola = aVar(2)'2=vem depois do ativas na url 'Response.Write N & " - " & & "
" 'locaweb->\\windows-pd-0001.fs.locaweb.com.br\WNFS-0001\webtecnoadm\web\ sPath = left(Request.ServerVariables("APPL_PHYSICAL_PATH"), Len(Request.ServerVariables("APPL_PHYSICAL_PATH"))-4) & "dados\" & sEscola & "\unidade.mdb" sPathOco = left(Request.ServerVariables("APPL_PHYSICAL_PATH"), Len(Request.ServerVariables("APPL_PHYSICAL_PATH"))-4) & "dados\" & sEscola & "\db1.mdb" end if sCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sPath & ";" sCnnOco = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sPathOco & ";" 'Response.Write sCNN Set oBD = Server.CreateObject("ADODB.Connection") oBD.ConnectionString = sCNN : oBD.Open %>