How to access Access database table info 
Author Message
 How to access Access database table info

I am trying to figure out how to get to the "Description" field that you
have when you are in "Design View" for a table in Access.
I am trying to access this field from VB6 code. How is this done?


Mon, 18 Feb 2002 03:00:00 GMT  
 How to access Access database table info
Here's how I do it:
----------------------------------------
Private Function Descript$(f As Field)
  On Error Resume Next
  Descript = f.Properties!Description
End Function
----------------------------------------
The "On Error" is necessary because you'll get an error if the field has no
description.


Quote:
> I am trying to figure out how to get to the "Description" field that you
> have when you are in "Design View" for a table in Access.
> I am trying to access this field from VB6 code. How is this done?



Mon, 18 Feb 2002 03:00:00 GMT  
 How to access Access database table info
I don't know that you can but you could try TableDefs

I assume you know how to connect to a Access Database using DAO.

myDataBase.TableDef(myIndex). Then Look for the Description - it does not
exist as such but you may find it by trial and error


Quote:
> I am trying to figure out how to get to the "Description" field that you
> have when you are in "Design View" for a table in Access.
> I am trying to access this field from VB6 code. How is this done?



Mon, 18 Feb 2002 03:00:00 GMT  
 How to access Access database table info
David uses the same method as  I do
but I use   On Error goto HasError

In HasError I check for the right error-number (property not found)
If so I put de fieldname in the Descript variable
then   resume next
Using this way the Descript Variable is always filled with something
(if not the description then the fieldname)

David J. Linden heeft geschreven in bericht ...

Quote:
>Here's how I do it:
>----------------------------------------
>Private Function Descript$(f As Field)
>  On Error Resume Next
>  Descript = f.Properties!Description
>End Function
>----------------------------------------
>The "On Error" is necessary because you'll get an error if the field has no
>description.



Tue, 19 Feb 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Updating linked table info in Access 97 database

2. MS Access DB - Copy Table A from Database A to Table A Database B

3. Importing an Access 2000 table into another Access 2000 database with VB Code

4. lock table for concurrent user-access with RDO and Access-Database

5. Attaching External Access Table to Access Database

6. lock table for concurrent user-access with RDO and Access-Database

7. lock table for concurrent user-access with RDO and Access-Database

8. dBASE IV table into Access Database table?

9. dBASE IV table into Access Database table?

10. Linking Access Tables in Different *.mdb Files, Populating an Access Table From Several Others

11. open Access table = locked Access table??

12. open Access table = locked Access table??

 

 
Powered by phpBB® Forum Software