Community
Showing results for 
Search instead for 
Do you mean 
Reply
Accepted Solution

Creating new database

Highlighted
Bronze Super Contributor
Posts: 1,284
Country: USA

Re: Creating new database

[ Edited ]

 

Have you looked into the RestoreDatabaseAs method. I used it a while back for another 3rd party product we developed. The client needed to create a database with pre-defined fields and business object such as Products and activity types. The code then uses the ACT Backup Zip file to restore as on the new target machine.

 

ACTAPP.ActFramework.RestoreDatabaseAs(dbName, _
dbHost, _
dbType, _
dbTargetFolder, _
userLogon, _
userPW, _
ZipFileName, _
ZipPW, _
progressBar, _
False)

 

-- Jim Durkin

Highlighted
Copper Contributor
Posts: 14
Country: United States

Re: Creating new database

I just stumbled on this month old thread looking for something else.

 

I'm not sure I understand the comment in an early reply from a moderator saying "you cannot create a new database in either the Framework or the UI".

 

There is a method in the Framework class:  ActFramework.CreateActDatabase()

 

It has several overloads.  I recall using this method to force instantiation of the Managers in the Framework (for purposes of high level testing) without having to login to a production database.  I also remember someone saying they use this method as a "facsimile" login, again, causing the Framework managers to instantiate when you don't have a User ID or password for an existing database.

 

This may be what you are looking for Alex.  But be forewarned.  I also remember that executing this method takes time -- enough time to brew a cup of coffee  -- actually, maybe 30 seconds or more before the call returns.

 

Highlighted
Employee
Posts: 34
Country: USA

Re: Creating new database

No "empty" ACT database is truly empty.  There are system tables that are populated.  

 

There are a couple of ways to make an empty ACT! database. 

 

As mentioned previously, you can use ActFramework.CreateActDatabase. This is a barebones, basic ACT database. 

 

If you want to make an empty copy of a database with customized schema, use ActFramework.CopyDatabase (string newDBName, string newDBLocation, string newSuppFilesLocation, ProductTier tier, bool share, Contact contact, ContactName contactName, string userLogOn, string password). 

 

This is equivalent to Save Copy As, empty copy. 

Highlighted
Astute Commentator
Posts: 10
Country: Russia

Re: Creating new database

Thank you!