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.
Who is Participating?
senadConnect With a Mentor Commented:
Place ADOConnection1 on the form,link it to your MSAccess database using connection string :MS Jet 4 OLE DB provider, Place ADOTable and a Datasource on the form,link ADOTable to your ADOConnection1 (set the ADOConnection1 connected to true,loginprompt false)  ,Table name to your table name,datasource to your table and the grid to your datasource.simple...
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.