drop column via ODBC with "active relation"

  • Thread starter Thread starter Olaf Krause
  • Start date Start date
O

Olaf Krause

Hi,

Situation:
* Access to a MS Access DB via ODBC
* Two columns of two tables a related (checked with MS Access GUI)
* I want to delete (drop) one colum of one table (which is not a key column)
but related to the other table

code:
commandstr="ALTER TABLE "+Name+" DROP COLUMN "+scheme.ColumnName;
//MLHIDE
cmd=AdoProviderFactory.GetCommand(commandstr,m_DB.Connection,m_DB.ProviderType);
try
{
cmd.ExecuteNonQuery();
}


Since there is a relation I get an error message - OK.
1. How can I get a list of relations via ODBC.NET.
2. How can I delete a relation

All the example I found are working on a dataset. But if I fill a dataset
via a ODBC adaption there a no relations...

commandstr += "SELECT * FROM \"" + TableName + "\"";
// do I have to change this, table is the one I want to drop a column
cmd = AdoProviderFactory.GetCommand(commandstr,
m_DB.Connection, m_DB.ProviderType);
adapter.SelectCommand = cmd;
try
{
DataSet destdataset = new DataSet();
adapter.Fill(destdataset);

Maybe I have to use the connection.GetSchema("WHATTOFILLHERE") methods to
get Relations via ADO .NET?

thx in advance
 
Maybe the subject was a bit misleading the so question again in shortform
1. How can I get a list of relations and constraints via ODBC.NET
2. How can I delete a relation/constraint

thx

Olaf
 
Still searching for a solution or at least a workaround - maybe there is a
simple one which I do not see..

thx

Olaf
 
Back
Top