Community
Showing results for 
Search instead for 
Do you mean 
Reply

Beginner stuck: am I doing the right thing?

Accepted Solution Solved
New Member
Posts: 3
Country: USA
Accepted Solution

Beginner stuck: am I doing the right thing?

Hi,

Maybe I am not even going about this correctly: I am trying to get the data out of the tables into data structures in C#, so that I can do some manipulation and reporting out on an internal webapp. I am just starting to try all this out, and am beginning with something very simple:

 

ActFrameWork work = new ActFrameWork(); work.LogOn(strPath, strUser, strPass);

 which turns around and throws a MissingMasterDatabase exception, no matter what I try.  I know the path is correct, because I can easily open other files in the same directory, etc.  The directory isn't, however, on the same server.  Is this a problem?  Any other insights greatly appreciated, it is frustrating to be stuck on something so simple so early on. Thanks.

 


Accepted Solutions
Solution
Accepted by topic author nKab
‎09-25-2015 03:20 AM
Employee
Posts: 33
Country: USA

Re: Beginner stuck: am I doing the right thing?

 

A missing master database exception essentially means it can't find a SQL Server Master database. Since it doesn't seem likely that you would have a ACT! SQL server instance with no master database, the exception may be a bit misleading. I would more readily suspect that you aren't really connecting to the SQL server you think you are, you are most likely hitting your own machine. Since you are getting the pad file from a network share, check to see if the pad file you are pointing to has a relative location the the SQL database that isn't resolvable from your machine. As an example from my dev box, here are the contents of a PAD file:

 

 

<?xml version="1.0" standalone="no"?>
<!DOCTYPE ACTDatabasePADFile>
<!--This file represents a Pointer to an Act Database or [PAD]-->
<ACTDatabase name="test0618" host="." location="C:\Users\TFAUST\Documents\ACT\ACT For Windows 12\Databases" type="Sql" />

 

Note the host entry  of "." This effectively means "localhost", If your PAD file looks this way, I think adding an actual computer name instead of a "." in the pad file would do the trick. Make a copy so you don't mess up others while you experiment Smiley Happy

 

 

As an aside, I would think any SQL Server instance you do have without a master database is not exactly usable.



 

Tim Faust
ACT! R&D

View solution in original post


All Replies
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Beginner stuck: am I doing the right thing?

Um, two lines of code isn't terribly helpful, but I'll give it a go and see if this helps.  It's in VB, but you should get the jist:

  

Dim ActFwk As New Act.Framework.ActFramework() ActFwk.LogOn(strPath, strUser, strPass)

 

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Beginner stuck: am I doing the right thing?

I just pulled up a C# app, and noticed the VB code probably did not help.  Here's a sample login on C#

 

ActFramework ACTFM = new ActFramework(); ACTFM.LogOn("C:\\Documents and Settings\\All Users\\Documents\\ACT\\ACT for Windows 11\\Databases\\ACT11Demo.PAD", "Chris Huffman", "");

 

 

 

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
New Member
Posts: 3
Country: USA

Re: Beginner stuck: am I doing the right thing?

Thanks, but I have been able to get this far.  The problem is when I run this code that the MissingMasterDatabase exception is thrown.  Any help on where to go from here?
Nickel Super Contributor
Posts: 441
Country: UK

Re: Beginner stuck: am I doing the right thing?

Run actdiag (start -> Run -> actdig) - does it start without error or say could not connect to sql instance?

 

Tom

Solution
Accepted by topic author nKab
‎09-25-2015 03:20 AM
Employee
Posts: 33
Country: USA

Re: Beginner stuck: am I doing the right thing?

 

A missing master database exception essentially means it can't find a SQL Server Master database. Since it doesn't seem likely that you would have a ACT! SQL server instance with no master database, the exception may be a bit misleading. I would more readily suspect that you aren't really connecting to the SQL server you think you are, you are most likely hitting your own machine. Since you are getting the pad file from a network share, check to see if the pad file you are pointing to has a relative location the the SQL database that isn't resolvable from your machine. As an example from my dev box, here are the contents of a PAD file:

 

 

<?xml version="1.0" standalone="no"?>
<!DOCTYPE ACTDatabasePADFile>
<!--This file represents a Pointer to an Act Database or [PAD]-->
<ACTDatabase name="test0618" host="." location="C:\Users\TFAUST\Documents\ACT\ACT For Windows 12\Databases" type="Sql" />

 

Note the host entry  of "." This effectively means "localhost", If your PAD file looks this way, I think adding an actual computer name instead of a "." in the pad file would do the trick. Make a copy so you don't mess up others while you experiment Smiley Happy

 

 

As an aside, I would think any SQL Server instance you do have without a master database is not exactly usable.



 

Tim Faust
ACT! R&D
Employee
Posts: 33
Country: USA

Re: Beginner stuck: am I doing the right thing?

An even easier approach would be to use the logon matching the following signature:

 

public void LogOn(string userName, string password, string databaseHost, string databaseName)

 

This would allow you to unambiguously specify the SQL host, and not worry about PAD files.

Tim Faust
ACT! R&D
Tuned Listener
Posts: 3
Country: United States

Re: Beginner stuck: am I doing the right thing?

Hi Tim,

 

I don't see that method for the ActFramework object. I'm using version 2009 SDK. Where is that method?

 

- tony

Nickel Super Contributor
Posts: 441
Country: UK

Re: Beginner stuck: am I doing the right thing?

 Dim actfwk As New Act.Framework.ActFramework
        actfwk.LogOn(strUsr, strPass, strHost, strDB)

 

Tom