Saludos.
Tengo la necesidad de abrir archivos FBD para la exportacion de informacion
Alguna lib que me permita hacerlo?
Gracias.
Local oServer, oQuery, oRow, i, x, aTables, aStruct, aKey
Local cServer := 'test.gdb'
Local cUser := 'sysdba'
Local cPass := 'masterkey'
Local nDialect := 1
Local cQuery
lOCAL nClrText:=10485760 // Color del texto
oServer := TFBServer():New(cServer, cUser, cPass, nDialect)
if oServer:NetErr()
alert("No Existe Base de Datos")
? oServer:Error()
return
end
oQuery := oServer:Query('SELECT code, dept, name, sales, salary, creation FROM test')
ln := 1
DO WHILE ! oQuery:Eof()
if ln>49
@ ln-46+1,20 say oQuery:FieldGet( 1 ) //con @ 1,1 say "dsdjsk" da error
@ ln-46+1,30 say oQuery:FieldGet( 2 )
@ ln-46+1,35 say oQuery:FieldGet( 3 )
else
@ ln+1,1 say oQuery:FieldGet( 1 ) //con @ 1,1 say "dsdjsk" da error
@ ln+1,10 say oQuery:FieldGet( 2 )
@ ln+1,15 say oQuery:FieldGet( 3 )
endif
ln++
oQuery:Skip()
END
? "Closing..."
return
#include "fivewin.ch"
FUNCTION Main()
LOCAL oServer, oQuery, oRow, i, x, aTables, aStruct, aKey,aDados:={}
LOCAL cServer := "c:\tec2000\Albano\Analista2.fdb"
LOCAL cUser := "sysdba"
LOCAL cPass := "masterkey"
LOCAL nDialect := 1
LOCAL cQuery
LOCAL nClrText:=10485760 // Color del texto
SET DATE BRIT
oServer := TFBServer():New(cServer, cUser, cPass, nDialect)
if oServer:NetErr()
alert("No Existe Base de Datos")
? oServer:Error()
return nil
end
oQuery := oServer:Query("SELECT id_ponto,nosso_numero FROM BOLETO_BANCARIO")
ln := 1
MsgInfo(IF(oQuery:Eof(),"SIM","NÂO"))
DO WHILE Ln<=100 .AND. .NOT. oQuery:Eof()
AADD(ADADOS,{oQuery:FieldGet( 1 ),oQuery:FieldGet( 2 ),oQuery:FieldGet( 3 )})
Ln++
oQuery:Skip()
END
xbrowse(adados)
xbrowse(oQuery)
RETURN nil
#include "fivewin.ch"
#include "AdoDb.ch"
FUNCTION Main()
LOCAL cDirLoc,oError,CNN,oIni,cIpServ:="",cBcoDados,aDados:={},oCursor
SET DATE BRIT
cDirLoc := Rtrim(( CurDrive()+":\"+CurDir() ))
cDirLoc += If(Right(cDirLoc,1)="\","","\")
IF .NOT. File(cDirLoc+"vfatec.ini")
MsgInfo("Aqruivo VFATEC.INI não encontrado !","Atenção")
ELSE
INI oIni FILE (cDirLoc+"vfatec.ini")
GET cIpServ SECTION "BancoDados" ENTRY "Ip" OF oIni
GET cBcoDados SECTION "BancoDados" ENTRY "ArquivoFdb" OF oIni
ENDINI
IF Empty(cIpServ) .OR. Empty(cBcoDados)
MsgInfo("Configuração para acesso ao banco de dados não definida !","Atenção")
ELSE
TRY
CNN:=CreateObject("ADODB.Connection")
CNN:Open("DRIVER=Firebird/InterBase(r) driver;UID=SYSDBA;PWD=masterkey;DBNAME="+cIpServ+":"+cBcoDados+";CHARSET=WIN1252;DIALECT=3;CLIENT=GDS32.dll")
//CNN:Open("DRIVER=Firebird/InterBase(r) driver;UID=SYSDBA;PWD=masterkey;DBNAME=10.10.1.11:C:\tec2000\albano\analista2.fdb;CHARSET=WIN1252;DIALECT=3;CLIENT=GDS32.dll")
CATCH oError
Error Connection CNN
RETURN nil
END
TRY
oCursor:=CreateObject("ADODB.Recordset")
CATCH oError
Error Connection CNN
RETURN nil
END
oCursor:Open("SELECT b.id_ponto,b.nosso_numero,b.valor_documento,b.processamento,p.nome_ponto FROM boleto_bancario AS b, ponto AS p WHERE b.valor_documento > 0 AND b.id_ponto=p.id_ponto and processamento > '2015-09-01'", CNN, 2, 3)
oCursor:MoveFirst()
DO WHILE .NOT. oCursor:Eof()
Aadd(aDados,{oCursor:Fields["nosso_numero"]:Value, oCursor:Fields["processamento"]:Value, oCursor:Fields["nome_ponto"]:Value, oCursor:Fields["valor_documento"]:Value})
oCursor:MoveNext()
ENDDO
xBrowse( aDados )
ENDIF
ENDIF
RETURN nil
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 50 guests