Pedrosa 2 de mai. de 2006
Sim tem como fazer, parece que o correio vende um cd com essa base em mdb, vc pode fazer uma popup que devolve esses dados:
//poupup
<html>
<head>
<link href= "../../Estilos/xx.css" rel= "stylesheet" type= "text/css" >
<link href= "../../Estilos/menu.css" rel= "stylesheet" type= "text/css" >
</head>
<body class= "fnd" bgcolor= "#ffffff" leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0" >
<script language= "JavaScript" >
function devolveCep(){
window.opener.frmDadosCliente.txtRua.value = document.frmCep.txtRuaCep.value;
window.opener.frmDadosCliente.txtBairro.value = document.frmCep.txtBairroCep.value;
window.opener.frmDadosCliente.txtCidade.value = document.frmCep.txtCidadeCep.value;
window.opener.frmDadosCliente.cboEstado.value = document.frmCep.txtEstadoCep.value;
window.close();
}
</script>
<form name= "frmCep" method= "post" >
<table width= "68%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<td width= "4" rowspan= "14" > </td>
<td width= "529" height= "20" > </td>
</tr>
<tr>
<td>
<table width= "100%" border= "0" cellpadding= "0" cellspacing= "0" >
<tr>
<td height= "20" class= "ttl" colspan= "3" >
<IMG height= 12 src= "../../Imagens/quadadro_sobre.gif" width= 11 >
Busca CEP</td>
</tr>
<tr>
<td height= "20" class= "lbl1" colspan= "3" > </td>
</tr>
<tr>
<td width= "25" class= "lbl1" > </td>
<td width= "165" height= "20" class= "lbl1" > Endereço: </td>
<td width= "351" height= "20" >
<input name= "txtRuaCep" class= "frmTxt1" value= " <? echo trim ( $Endereco ); ?> " size= "40" maxlength= "75" readonly >
</td>
</tr>
<tr>
<td class= "lbl1" > </td>
<td height= "20" class= "lbl1" > Bairro:</td>
<td height= "20" >
<input name= "txtBairroCep" class= "frmTxt1" value= " <? echo trim ( $Bairro ); ?> " size= "40" maxlength= "75" readonly ></td>
</tr>
<tr>
<td class= "lbl1" > </td>
<td height= "20" class= "lbl1" > Cidade:</td>
<td height= "20" >
<input name= "txtCidadeCep" class= "frmTxt1" value= " <? echo trim ( $Cidade ); ?> " size= "40" maxlength= "75" readonly ></td>
</tr>
<tr>
<td class= "lbl1" > </td>
<td height= "20" class= "lbl1" > Paí s: </td>
<td height= "20" >
<input name= "txtPaisCep" class= "frmTxt1" value= "Brasil" size= "40" maxlength= "75" readonly ></td>
</tr>
<tr>
<td width= "25" class= "lbl1" > </td>
<td width= "165" height= "20" class= "lbl1" > Estado: </td>
<td width= "351" height= "20" >
<input name= "txtEstadoCep" class= "frmTxt1" value= " <? echo trim ( $Estado ); ?> " size= "5" maxlength= "2" readonly >
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align= "center" >
<input type= "button" value= "Devolver" class= "bto1" onClick= "devolveCep();" >
<input type= "button" value= "Fechar" class= "bto1" onClick= "window.close();" >
</td>
</tr>
</table>
</form>
</body>
</html>
//Formulario
<script>
function abrirJanela(lnk){
if(document.forms[0].txtCep.value==""){
alert("Informe o CEP!");
document.forms[0].txtCep.focus();
return;
}
window.open(lnk,'','width=350, height=250, top=0, left=0, toolbar=no, menubar=no, resizeable=no');
}
</script>
<td height= "20" class= "lbl1" > CEP: </td>
<td height= "20" >
<input name= "txtCep" value= " <? echo $strCep ?> " class= "frmTxt1" size= "10" maxlength= "8" >
<img src= "../../Imagens/bt_pesquisar.jpg" onClick= "javascript:abrirJanela('BuscaCep.php?srtCep=' + document.forms[0].txtCep.value);" alt= "Buscar CEP" >
</td>
Este exemplo eu tinha em PHP, vc precisa adaptar para seu caso, carrega as informações do bd nos campos input.
danieldestro 2 de mai. de 2006
Se você buscar aqui no GUJ por “CEP” vai achar a resposta.
Boa sorte.