Jump to content
Fivewin Brasil

Banco de Dados ACCESS MDB


dorneles

Recommended Posts

Dorneles, bom dia.

O office 2003, já salva em dbf direto.

Mas..


*******************************************************************************

* Versão 1.0 *

*******************************************************************************

//#include "atualw.ch"

#include "adordd.ch"

Function Main

Local cCodigo,cDescricao,Tecla,criterio

Local cn := CreateObject("ADODB.Connection")

Local rs := CreateObject("ADODB.Recordset")

set date brit

set cent on

cls

cn:Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=nomebanco.mdb")

sql:= "select * from clientes c inner join municipios m on c.idcidaderes = m.idmunicipio order by c.idcliente"

rs:Open(sql, cn, 2, 3)

select 1

use cliente

zap

Rs:MoveFirst()

do while !Rs:Eof()

select 1

append blank

replace ccodigo with RS:Fields["IDCliente"]:Value()

replace ccgc with RS:Fields["CpfCnpj"]:Value()

replace crazao with RS:Fields["Nome"]:Value()

if RS:Fields["Bloqueado"]:Value()

replace cbloqueia with "S"

else

replace cbloqueia with "N"

endif

if valtype(RS:Fields["Tratamento"]:Value()) <> "U"

replace cfanta with RS:Fields["Tratamento"]:Value()

endif

if valtype(RS:Fields["Nascimento"]:Value()) <> "U"

replace cdtnasc with RS:Fields["Nascimento"]:Value()

endif

replace cie with RS:Fields["RgInscricao"]:Value()

if valtype(RS:Fields["CONTATO"]:Value()) <> "U"

replace ccontato with RS:Fields["CONTATO"]:Value()

endif

replace cender with RS:Fields["EnderecoRes"]:Value()+", "+RS:Fields["NumeroRes"]:Value()

replace cbairro with RS:Fields["BairroRes"]:Value()

replace ccidade with RS:Fields["Descricao"]:Value()

replace cuf with RS:Fields["UF"]:Value()

replace ccep with substr(RS:Fields["CepRes"]:Value,1,2)+"."+substr(RS:Fields["CepRes"]:Value,3,3)+"-"+substr(RS:Fields["CepRes"]:Value,6,3)

//replace cfone with "("+strzero(val(RS:Fields["TelefoneResDdd"]:Value),2)+")"+RS:Fields[substr(TelefoneRes,1,4)]:Value+"-"+RS:Fields[substr(TelefoneRes,4,4)]:Value

replace cfax with ""

//replace ccelul with "("+strzero(val(RS:Fields["celularDdd"]:Value),2)+")"+RS:Fields[substr(Celular,1,4)]:Value+"-"+RS:Fields[substr(Celular,4,4)]:Value

replace cenderent with cender

replace cbairent with cbairro

replace ccident with ccidade

replace cufent with cuf

if valtype(RS:Fields["CADASTRO"]:Value()) <> "U"

replace ccadastro with RS:Fields["CADASTRO"]:Value

endif

replace cobs with "CONVERTIDO!!!"+RS:Fields["Observacoes"]:Value

Rs:MoveNext()

Enddo

rs:Close()

Cn:Close()

close databases

return

id=code>id=code>

Leco

Five PPC

Harbour 1.0.1 - 1999-2008

Link to comment
Share on other sites

citação:

tentei abrir pelo access, mas ele da uma mensagem que EU NAO TENHO PERMISSAO PARA ABRIR.

FW 2.6 + HB 0.9950 + Pelles + Clipper 5.3 + VLib + xDevStudio

leofy.jpg


id=quote>id=quote>

Ai vai precisar quebrar a senha, eu tinha um programa, mas só DEUS que sabe a onde está.

O código acima le ele depois de ter tirado a senha.

Leco

Five PPC

Harbour 1.0.1 - 1999-2008

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...