How do I check if specified column exists in MS Access database?
<p>I need my program check if specified column exists in MS Access 2000 database, and if it doesn't - add it. I use .NET Framework 2.0
I tried to use oleDbConnection.GetSchema() method, but couldn't find column names in metadata (i'm really not a pro, huh) and any specification on msdn.
I would appreciate any help.</p>

<p>Thanks for answers.
Here is solution i used in my code:</p>

<pre><code>bool flag = false; string[] restrictions = new string[] { null, null, mytable };
DataTable dtColumns = oleDbConnection1.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Columns, restrictions);
foreach (DataRow row in dtColumns.Rows) 
{ 
    if (mycolumnname==(string)row["COLUMN_NAME"]) flag = true;
}
</code></pre>
