I am working with Microsoft visual studio 2005.Can anyone tell me how to get table names and column names of a MS access database?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Typically, you should the metadata facilities of your database driver to do that. All database call level APIs I have heard of supply methods/functions/procedures that can return database metadata, typically as a resultset.
You didn’t mention any language, so lets assume you’re using C#. In that case, you’d make a OleDB (OleDB is driver framework for .NET languages) connection object, and invoke the
GetOleDbSchemaTablemethod on it. This will then give you aDataTableobject that gives you access to the rows of data that convey this information.For an OleDB example, see: http://msdn.microsoft.com/en-us/library/aa288452(VS.71).aspx
For the GetOleDbSchemaTable method, see: http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbconnection.getoledbschematable(VS.71).aspx
For information on the types of metadata provided by OleDB, see: http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbschemaguid_members(VS.71).aspx