Community
Showing results for 
Search instead for 
Do you mean 
Reply

Database files location

Accepted Solution Solved
Copper Super Contributor
Posts: 71
Country: Canada
Accepted Solution

Database files location

I am looking for some VB code that will put the database location, well more specifically the database files location into a string? Any thoughts?


Accepted Solutions
Solution
Accepted by topic author MattRobillard
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Database files location

The ActDatabaseManager class has a public property for database path that should return what you're looking for. I didn't test this...

 

string dbLoc = ActApp.ActFramework.ActDatabase.DatabasePath;
Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Solution
Accepted by topic author MattRobillard
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Database files location

The ActDatabaseManager class has a public property for database path that should return what you're looking for. I didn't test this...

 

string dbLoc = ActApp.ActFramework.ActDatabase.DatabasePath;
Matthew Wood
Act! SDK Support
Community Moderator
Employee
Posts: 34
Country: USA

Re: Database files location

ActApp.ActFramework.ActDatabase.DatabasePath will give you the path to the adf file.  Which should be in the same vicinity as the database files, but would require extrapolating the path.  

 

For the actual path to the database files (i.e. the folder called -database files) use Act.Framework.SupplementalFileManager.Workgroup.GetLocalPath(ActFramework actFramework)

 

 

public Act.Framework.ActFramework framework;

string text = framework.SupplementalFileManager.Workgroup.GetLocalPath(framework);

 

It returned the complete path to the database files folder.