Jump to content

Paradox data base


Recommended Posts

Hi,

I need to access a data base having more files (.db, .px, .xg0, .xg1, .xg2, .yg0, .yg1, .yg2) and by googeling those extentions I found that this is a paradox data base format, and now, this is the problem.

How do I connect to this type of data base for reading data?

I found that the .db file is the main data base and the other files are index files...or something.

Please help me with this issue.

Thx in advance,

Mihai

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Link to comment
Share on other sites

Run ODBCAD32.exe, look at the Drivers tab and see if you have an ODBC driver for that DB type loaded (i.e "Microsoft Paradox Driver (*.db)"). If so, you can probably use the ADO COM interface to access the data. Search the forum for ADODB examples.

:idea:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Run ODBCAD32.exe, look at the Drivers tab and see if you have an ODBC driver for that DB type loaded (i.e "Microsoft Paradox Driver (*.db)"). If so, you can probably use the ADO COM interface to access the data. Search the forum for ADODB examples.

:idea:

Thx alot! I after a bit of googeling I managed to connect to a paradox database, but still there is a problem...a odd one.

I used a Qerry on all tables and it returns all column names as "NoName"....why is that?

the querry I used is: "SELECT * FROM MRF2009"

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Link to comment
Share on other sites

Thx alot! I after a bit of googeling I managed to connect to a paradox database, but still there is a problem...a odd one.

I used a Qerry on all tables and it returns all column names as "NoName"....why is that?

the querry I used is: "SELECT * FROM MRF2009"

I have also googled this problem, but I haven't got a solution or a cause for this problem...it is strange...some other guys complained about it, but no solution.

Please help

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Link to comment
Share on other sites

I have also googled this problem, but I haven't got a solution or a cause for this problem...it is strange...some other guys complained about it, but no solution.

Please help

The code I used is:

#include <_sql_mod.au3>
#include <array.au3>

$FilePath = "P:\Atto\GestPro\ARELCO.g32\"
$db_adodb = _SQL_Startup()
$ret = _SQL_ParadoxConnect($db_adodb, $FilePath,$FilePath)
;$ret = _SQL_ParadoxJetConnect($db_adodb, $FilePath,$FilePath)
If $ret = $SQL_OK Then
    Local $aResult, $iRows, $iColumns
    $vQuery = "SELECT * FROM MRF2009"
    _SQL_GetTable2D($db_adodb, $vQuery, $aResult, $iRows, $iColumns)
    _ArrayDisplay($aResult)
    _SQL_Close($db_adodb)
Else
    MsgBox(48,"Eroare","Nu merge!")
EndIf

where _SQL_ParadoxConnect is:

Func _SQL_ParadoxConnect($ADODBHandle = -1, $sFilePath1 = "",$Dir="")
    $SQLErr = ""
    If $ADODBHandle = -1 Then $ADODBHandle = $SQL_LastConnection

    If Not IsObj($ADODBHandle) Then
        $SQLErr = "Invalid ADODB.Connection object, use _SQL_Startup()"
        Return SetError($SQL_ERROR, 0, $SQL_ERROR)
    EndIf

    $ADODBHandle.Open("Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;DefaultDir="&$Dir&";Dbq=" & $sFilePath1 & ";CollatingSequence=ASCII;")
    If @error Then
        $SQLErr = "Connection Error"
        Return SetError($SQL_ERROR, 0, $SQL_ERROR)
    EndIf

    Return SetError($SQL_OK, 0, $SQL_OK)

EndFunc

and _SQL_ParadoxJetConnect is:

Func _SQL_ParadoxJetConnect($ADODBHandle = -1, $sFilePath1 = "",$Dir="")
    $SQLErr = ""
    If $ADODBHandle = -1 Then $ADODBHandle = $SQL_LastConnection

    If Not IsObj($ADODBHandle) Then
        $SQLErr = "Invalid ADODB.Connection object, use _SQL_Startup()"
        Return SetError($SQL_ERROR, 0, $SQL_ERROR)
    EndIf
    ;
    $ADODBHandle.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&$sFilePath1&";Extended Properties=Paradox 5.x;")
    If @error Then
        $SQLErr = "Connection Error"
        Return SetError($SQL_ERROR, 0, $SQL_ERROR)
    EndIf

    Return SetError($SQL_OK, 0, $SQL_OK)

EndFunc

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Link to comment
Share on other sites

I have discovered another thing...it shows the column names for some tables with Paradox 7.0, but for some tables with Paradox 7.0 it won't. And one more thing: it opens databases Paradox 5.0 and 4.0, but it crashes when querryed.

Did someone else had those problems?

Does anyone have a solution?

Thx in advance

Mihai

Edit: Paradox 4.0, 5.0 and 7.0 reffers at the table level...I'm not really sure what that means

Edited by darzanmihai

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...