Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get MS Access Query Column Names
Message
From
22/12/2009 19:05:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01440055
Message ID:
01440253
Views:
27
>>>I'm trying to get the column names of queries in MS Access . So far I have:
>>>
>>>
>>>public static void Test()
>>>{
>>>    OleDbConnection connection = new OleDbConnection(AccessConnString);
>>>
>>>    try
>>>    {
>>>        connection.Open();
>>>    }
>>>    catch (Exception e)
>>>    {
>>>        throw e;
>>>    }
>>>
>>>    DataTable t1 = connection.GetSchema("Columns");         // Returns Table column names
>>>    DataTable t2 = connection.GetSchema("Procedures");      // Returns all Query names
>>>    DataTable t3 = connection.GetSchema("Views");           // Returns all Subquery names
>>>
>>>    connection.Close();
>>>}
>>>
>>>
>>>I cannot see to figure out how to get the column names for queries/subqueries. Anyone know how to do this?
>>
>>
>>Assuming you are doing this against Norhwind.mdb:
>>
>>
DataTable t = con.GetSchema("columns",new string[] {null,null,"Sales By Category",null});
>>Cetin
>
>
>I already tried this. It returns no rows.

Then there isn't such a query/view.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform