Alguem consegue corrigir todos os ODBC Driver em 3.51 devem ser corrigidos para 5.1 do codigo abaixo:
<%
If Request.Form() <> "" Then
Set objCon = Server.CreateObject("ADODB.Connection")
objCon.Open Application("conexao_cep")
ComandoSQL = "SELECT * FROM " & Request.Form("estado") & " WHERE localidade LIKE '%" & Prepara_busca(Request.Form("cidade")) & "%' AND nome LIKE '%" & Prepara_busca(Request.Form("logradouro")) & "%'"
Set objRS_log = Server.CreateObject("ADODB.Recordset")
objRS_log.CursorLocation = 2
objRS_log.CursorType = 1
objRS_log.LockType = 1
objRS_log.Open ComandoSQL, objCon,,, &H0001
Response.Write "<font color='#60707F'><b><font color='#CF0800'>Pesquisar CEP</font><br>"
Response.Write "</b>Veja abaixo o resultado da pesquiza<br><br>"
Response.Write "<table width=100% border=1 bordercolor=gainsboro cellspacing=0 cellpadding=2 class=texto>"
Response.Write " <tr>"
Response.Write " <td bgcolor=whitesmoke><strong>Cidade</strong></td>"
Response.Write " <td bgcolor=whitesmoke><strong>Bairro</strong></td>"
Response.Write " <td bgcolor=whitesmoke><strong>Logradouro</strong></td>"
Response.Write " <td bgcolor=whitesmoke><strong>Complemento</strong></td>"
Response.Write " <td bgcolor=whitesmoke><strong>CEP</strong></td>"
Response.Write " </tr>"
If Not objRS_log.EOF Then
While Not objRS_log.EOF
cep = objRS_log("cep")
Response.Write " <tr>"
Response.Write " <td>" & objRS_log("localidade") & "</td>"
Response.Write " <td>" & objRS_log("bai_ini") & "</td>"
Response.Write " <td>" & objRS_log("nome") & "</td>"
Response.Write " <td>" & objRS_log("complemento") & "</td>"
Response.Write " <td><span OnClick=""opener.document.cesta_produtos.cep1.value='" & Left(cep,5) & "';opener.document.cesta_produtos.cep2.value='" & Right(cep,3) & "';window.close();"" style='cursor:hand'><u>" & cep & "</u></span></td>"
Response.Write " </tr>"
Set cidade = Nothing
Set complemento = Nothing
Set bairro = Nothing
Set logradouro = Nothing
Set cep = Nothing
objRS_log.MoveNext
Wend
End If
ComandoSQL = "SELECT * FROM Cidade WHERE cep <> '' AND uf = '" & Request.Form("estado") & "' AND nome LIKE '%" & Prepara_busca(Request.Form("cidade")) & "%'"
Set objRS_localidade = Server.CreateObject("ADODB.Recordset")
objRS_localidade.CursorLocation = 2
objRS_localidade.CursorType = 1
objRS_localidade.LockType = 1
objRS_localidade.Open ComandoSQL, objCon,,, &H0001
If Not objRS_localidade.EOF Then
While Not objRS_localidade.EOF
cep = objRS_localidade("cep")
Response.Write " <tr>"
Response.Write " <td>" & objRS_localidade("nome") & "</td>"
Response.Write " <td>-</td>"
Response.Write " <td>-</td>"
Response.Write " <td>-</td>"
Response.Write " <td nowrap><span OnClick=""opener.document.cesta_produtos.cep1.value='" & Left(cep,5) & "';opener.document.cesta_produtos.cep2.value='" & Right(cep,3) & "';window.close();"" style='cursor:hand'><u>" & cep & "</u></span></td>"
Response.Write " </tr>"
objRS_localidade.MoveNext
Wend
End If
objRS_localidade.Close
Response.Write "</table>"
objRS_log.Close
objCon.Close
Set objCon = Nothing
Set ComandoSQL = Nothing
Set objRS_log = Nothing
Else
%>
Grato,
Daniel Ambrosio