Export revit file to data base access

Export revit file to data base access

Anonymous
Not applicable
657 Views
1 Reply
Message 1 of 2

Export revit file to data base access

Anonymous
Not applicable

Hi everyone!

I developing my addin using C# 2012. I need to export / import my model revit to an MS-Access database, similar to DB Link, is possible from the Revit API?

The addin db_link exports and imports to access but not i may execute querys and procedures, must be from MS-access, want to run querys and procedures from my adddin without opening MS-Acccess.

 

Thanks!

0 Likes
658 Views
1 Reply
Reply (1)
Message 2 of 2

Dale.Bartlett
Collaborator
Collaborator

Hi, I realise English is not your first language, so let me see if this is your idea:

  1. Export Revit database to MS Access
  2. Link to MS Access database via your Revit addin
  3. Query/Edit MS Access database via your Revit addin
  4. Import updated MS Access database to Revit

Item 1 and 4 can be accomplished with Revit DB Link. Items 2 and 3 can be done in the same way that any application can connect and edit a MS Access database. Lots of examples like this from Stack Overflow:

using System.Data.Odbc;
using(OdbcConnection myConnection = new OdbcConnection())
{
    myConnection.ConnectionString = myConnectionString;
    myConnection.Open();
    //execute queries, etc
}
where myConnectionString is something like this:
myConnectionString = @"Driver={Microsoft Access Driver (*.mdb)};" + 
"Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;

Regards, Dale

 




______________
Yes, I'm Satoshi.