Book a Demo

Author Topic: Search for Data Type in .EAP  (Read 2522 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Search for Data Type in .EAP
« on: November 20, 2009, 02:10:09 pm »
Hi,

Elsewhere, I've posted that there are incompatibilities between the .EAP repository definitions of certain field types (particularly Booleans) and the definitions in other types of (server) repositories (specifically SQL Server).

We've been fixing them on a case by case basis, but now we want to fix them once and for all...  The problem is I can't locate the mechanism to search an .EAP  for all columns with datatype...

I've enabled the system and hidden tables options. I've even used Rick Fisher's marvellous FindAndReplace, but Data Type is NOT one of the properties I can search on.

Does anyone know how to search an MS Access (2007) DB to retrieve a lists of columns whose data type is as specified?

Do I have to write some VB or is there a more direct UI way?

TIA,
Paolo
« Last Edit: November 20, 2009, 02:10:43 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Search for Data Type in .EAP
« Reply #1 on: November 20, 2009, 03:15:06 pm »
Wrote some VB code...
Code: [Select]
Sub Main()

    Dim oConnection As New ADODB.Connection
    oConnection.Open "Provider='Microsoft.Jet.OLEDB.4.0';" & _
        "Data Source=<File Reference>';"   '<- Insert the EAP file path here
    Dim oCatalog As New ADOX.Catalog
    Set oCatalog.ActiveConnection = oConnection
    Dim oTable As ADOX.Table
    For Each oTable In oCatalog.Tables
        If oTable.Type = "TABLE" Then
            Debug.Print oTable.Name
            Dim oColumn As Column
            For Each oColumn In oTable.Columns
                If oColumn.Type = <Data Type> Then _  '<- Set data type here...
                         Debug.Print "    " + oColumn.Name
             Next
        End If
    Next
    
    
End Sub
(Don't forget to add the appropriate references...)

I'm still interested in whether there's a non-programmatic way of getting the Data Type.

Enjoy,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!