<% response.buffer=true %> <% 'response.write "PÁGINA TRAVADA" 'response.end %> Atualização do Banco de Dados SQL <% ''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'if xnove = "PINGUELOW" then ''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Session.Timeout = 1000 arquivo = "/grupofarma/login/txt/ATUSQL_"&cstr(day(now))&cstr(month(now))&right(year(now),2)&".txt" arquivo2 = "e:\sites\grupofarma\login\txt\ATUSQL_"&cstr(day(now))&cstr(month(now))&right(year(now),2)&".txt" Dim fs, d, s Dim conteudo conteudo = "" Set fs = Server.CreateObject("Scripting.FileSystemObject") Set d = fs.CreateTextFile(server.MapPath(arquivo),true) numero_1 = "00" dia = day(now) xdia = Cdbl(numero_1) + Cdbl(dia) xdia = Right(Cstr(xdia + 1000000000000),Len(numero_1)) numero_1 = "00" mes = month(now) xmes = Cdbl(numero_1) + Cdbl(mes) xmes = Right(Cstr(xmes + 1000000000000),Len(numero_1)) ConnString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=s:\home\gtamultimidia\dados\gfarma_prevsaude.mdb;" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'if bosta="sim" then ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Set conn = Server.CreateObject("ADODB.Connection") conn.Open ConnString Set rs = Server.CreateObject("ADODB.Recordset") rs.open "Select * From tb_usuarios ORDER BY cod", conn, 3 'rs.open "Select * From tb_usuarios ORDER BY usuario_old", conn, 3 numcampos = rs.recordcount if rs.eof then rs.close conn.close set rs = nothing set conn = nothing response.write "







Não tem nenhum novo cliente a ser enviado para Prevsaúde. #59
" response.end end if while not rs.eof ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 30 cptemp = rs("cod_id_usuario") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 3 cptemp = rs("cod_associado") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&"0" next vartemp = vartemp&cstr(cptemp) conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 40 cptemp = rs("associado") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 15 cptemp = rs("associado_tel") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ' response.write rs("usuario_old")&"
" tamtemp = 40 cptemp = rs("usuario_old") if isnull(rs("usuario_old")) then cptemp = " " lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 25 cptemp = rs("usuario") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 15 cptemp = rs("logradouro") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 40 cptemp = rs("logradouro_end") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 40 cptemp = rs("logradouro_TXT") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 6 cptemp = rs("logradouro_n") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 20 cptemp = rs("complemento") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 30 cptemp = rs("bairro") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 30 cptemp = rs("cidade") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 2 cptemp = rs("uf") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 9 cptemp = rs("cep") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 50 cptemp = rs("cep_txt") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' conteudo = conteudo&rs("sexo") ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 cptemp = cstr(rs("dt_nasc")) lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp numero_1 = "00000000" dt = rs("dt_nasc_TXT") xdt = Cdbl(numero_1) + Cdbl(dt) xdt = Right(Cstr(xdt + 10000000000000),Len(numero_1)) conteudo = conteudo&xdt ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 4 cptemp = rs("ddd") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 15 cptemp = rs("telefone") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 15 cptemp = rs("telefone_txt") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 cptemp = rs("rg") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 2 cptemp = rs("rg_uf") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 11 cptemp = rs("cpf") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = "0"&vartemp next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 11 cptemp = rs("cpf_dep") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = "0"&vartemp next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' conteudo = conteudo&rs("tipo_operacao") ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 10 if rs("dt_inativacao") > "" then cptemp = cstr(rs("dt_inativacao")) else cptemp = " " end if lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 8 cptemp = rs("dt_inativacao_TXT") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = "0"&vartemp next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' tamtemp = 30 cptemp = rs("cod_id_titular") lentemp = tamtemp - len(cptemp) if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 150 cptemp = rs("email") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 200 cptemp = "CADASTRADO EM: "&rs("d_cad")&"-"&rs("h_cad")&"-"&rs("ip_cad") if rs("d_alt") > "" then cptemp = cptemp & " | ALTERADO EM: "&rs("d_alt")&"-"&rs("h_alt")&"-"&rs("ip_alt") if rs("d_exclu") > "" then cptemp = cptemp & " | EXCLUÍDO EM: "&rs("d_exclu")&"-"&rs("h_exclu")&"-"&rs("ip_exclu") lentemp = tamtemp - len(cptemp) vartemp = "" for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp conteudo = conteudo&rs("enviado_sn") conteudo = conteudo&rs("enviado_sn_petrone") tamtemp = 10 cptemp = rs("enviado_d") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 10 cptemp = rs("enviado_d_petrone") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 10 cptemp = rs("enviado_h") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 100 cptemp = rs("obs") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 10 cptemp = rs("d_cad") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp tamtemp = 10 cptemp = rs("d_alt") lentemp = tamtemp - len(cptemp) vartemp = "" if not IsNumeric(lentemp) then lentemp = tamtemp cptemp = "" end if for x = 1 to lentemp vartemp = vartemp&chr(32) next vartemp = cstr(cptemp)&vartemp conteudo = conteudo&vartemp ''''''''''''''''''''''''''''''''''''''''''''' ' conteudo = conteudo&vbcrlf d.writeline(conteudo) conteudo = "" rs.movenext wend rs.close conn.close set rs = nothing set conn = nothing d.close() set f = nothing response.write "

1. TXT DO MDB GERADO COM ÊXITO!

" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' %>