Link to home
Start Free TrialLog in
Avatar of Benvor
BenvorFlag for South Africa

asked on

Delphi and MS Access lookup value

Hi Experts.

Is it possible to get the value of the row source of a MS Access table, inside Delphi?

If possible, how do I implement this value into my Delphi database project, using a normal ADOTable, DataSource and a DBGrid, or any other object.
untitled1.bmp
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

You can use DAO to get to the properties of that table field:

Dim dbs As DAO.DAtabase
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim i As Integer

Set dbs = OpenDatabase("Path to your db")
Set tdf = dbs.TableDefs("YourTableName")
Set fld = tdf.Fields("YourFieldName")

For i = 0 to fld.Properties.Count
  If fld.Properties(i).Name = "RowSource" Then
    '/this is the RowSource value
  End If
Next i





ASKER CERTIFIED SOLUTION
Avatar of senad
senad
Flag of Slovenia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial