Existe Algun Libreria o RDD para Paradox
Posted: Sat Oct 25, 2014 1:39 am
Saludos Al Fórum, Existe Algina Librería o RDD para manejar base de datos Paradox. O Alquien Tiene algún ejemplo que funcione,
Gracias
Gracias
www.FiveTechSoft.com
https://forums.fivetechsoft.com/
Code: Select all
/*
* v.1.0 23-02-2016
* (c)2016 Joaquim Ferrer <quim_ferrer@yahoo.es>
* Programa:
* Acceso a tablas Paradox > 5.x mediante FW ADO
* Recursos:
* Obtener cadena de conexión
* https://www.connectionstrings.com/
* Visores y utilidades Paradox
* http://www.mitec.cz/Data/XML/data_downloads.xml
* http://www.sportamok.com/development/download-components/delphi/paradox-dbase-setup.exe
*/
#include "fivewin.ch"
function main()
// Antiguo driver CA-Clipper, sirve hasta Paradox 3.x
// No se ha migrado a Harbour
//REQUEST DBPX
//USE familia INDEX familia VIA "DBPX"
local cProvider, cDataSource, cString, cSelect, cBuffer
local oServer, oRecord
/* Paradox database */
cProvider := "Microsoft.Jet.OLEDB.4.0"
cDataSource := "db"
cProperties := "Paradox 5.x"
cString := "Provider="+ cProvider +';'
cString += "Data Source="+ cDataSource +';'
cString += "Extended Properties="+ cProperties
/* Connection */
oServer:= CreateObject( "ADODB.Connection" )
oServer:CommandTimeOut := 0
TRY
oServer:Open( cString )
CATCH oError
? oError:Description, "No es posible abrir una conexión global con "+ cDataSource
return .F.
END
oRecord:= CreateObject( "ADODB.Recordset" )
oRecord:CacheSize := 50
oRecord:CursorLocation := 3 //adUseClient
oRecord:CursorType := 2 //adOpenStatic
oRecord:LockType := 3 //adLockOptimist
cSelect := 'SELECT * FROM idiomas.db'
TRY
oRecord:Open( cSelect, oServer )
CATCH oError
? oError:Operation, oError:Description, cSelect
return .F.
END
/*
Estructura
adVarWChar 202 Indicates a null-terminated Unicode character string.
adVarNumeric 139 Indicates a numeric value.
*/
cBuffer :=""
for i:= 1 to oRecord:Fields:Count
cBuffer += oRecord:Fields:item(i-1):Name
cBuffer += cValToChar(oRecord:Fields:item(i-1):Type)
cBuffer += cValToChar(oRecord:Fields:item(i-1):DefinedSize)
next
? cBuffer
? "RecordCount", oRecord:RecordCount
/* Registros */
cBuffer :=""
do while !oRecord:Eof()
cBuffer += oRecord:fields("NOMBRE"):value + CRLF
oRecord:MoveNext()
enddo
oRecord:Close()
oServer:Close()
? cBuffer
return .T.
//---------------------------------------------------------------------------------------------------------//