fetching field names from a table in MS Access
-
Hey, I m trying to fetch field names from a table in an access database. can anybody tell me how to do it is there any table that contain all the field names or any other way to get i m using VC++ 6.0 thank you
Regards, Pankaj Sachdeva "There is no future lies in any job" "but" "future lies in the person who holds the job"
-
Hey, I m trying to fetch field names from a table in an access database. can anybody tell me how to do it is there any table that contain all the field names or any other way to get i m using VC++ 6.0 thank you
Regards, Pankaj Sachdeva "There is no future lies in any job" "but" "future lies in the person who holds the job"
What I do, with all the types of database I've yet encountered, is to use the DataReader's GetSchemaTable method. (I use C#) Open the connection -- con.Open() ; Set the command -- cmd.CommandText = "SELECT * FROM table" ; Use ExecuteReader -- reader = cmd.ExecuteReader() ; Call GetSchemaTable -- table = reader.GetSchemaTable() ; Cancel the Command -- cmd.Cancel ; (Not all databases support this.) Close the DataReader -- reader.Close() ; Close the connection -- con.Close() ;