Hi all,
I have an Access 2002-2003 project (.adp) that uses the SQL datalink connection to an SQL database (not "linked tables"). The tables work OK and are listed in Access as "tablename(dbo)". I need a way to get a list of fields in one of these tables. I've tried DAO methods, but get an error at the db.TableDefs(table) command. It doesn't seem to behave the same if these were local or linked tables.
How can I get a list of the fields in one of these SQL connected tables? This is the code I tried:
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Set db = CurrentDb()
Set tdf = db.TableDefs(dbo.departments) <-- error here is "424 object required".
Thanks.
I have an Access 2002-2003 project (.adp) that uses the SQL datalink connection to an SQL database (not "linked tables"). The tables work OK and are listed in Access as "tablename(dbo)". I need a way to get a list of fields in one of these tables. I've tried DAO methods, but get an error at the db.TableDefs(table) command. It doesn't seem to behave the same if these were local or linked tables.
How can I get a list of the fields in one of these SQL connected tables? This is the code I tried:
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Set db = CurrentDb()
Set tdf = db.TableDefs(dbo.departments) <-- error here is "424 object required".
Thanks.