Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Initial catalog creation
Fri, Jul 8 2016 7:06 AMPermanent Link

Matthew Jones

The sample code for creating the database is as follows:

// Set up the connection - notice that we're using the system-defined
Configuration database initially
EDBConnection DataConnection = new EDBConnection(@"TYPE=LOCAL;" +
      "CONFIGPATH=" + ApplicationPath + ";" +
      "DATABASE=Configuration;" +
      "UID=Administrator;" +
      "PWD=EDBDefault");

// Open the connection
DataConnection.Open();


Now, that Open will create the catalog if it does not exist. Which is
fine, but if I specify a different password in the connection, the Open
fails because it doesn't match the default. Shouldn't it pick up the
password from the connection string? And the encryption settings etc
too?

Now that I'm understanding this more, the encryption and different
passwords complicate it a lot, because if I use my values and it
doesn't exist, then I can't access it as the password doesn't match. If
I start off assuming defaults, then I'd have to code changing all the
parameters.

Or perhaps there is a "defaults" somewhere that I've missed.

What is the standard way to manage this? I suspect the sensible thing
will be to check if the catalog files exist or not, and if not, copy in
my default set. Then I will have the passwords I'm expecting.

Thanks, Matthew
Fri, Jul 8 2016 6:13 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Now, that Open will create the catalog if it does not exist. Which is fine, but if I specify a different password in the connection, the Open fails because it doesn't match the default. Shouldn't it pick up the password from the connection string? And the encryption settings etc too? >>

It does indeed do what you describe, so I'm not sure what you're referring to.  Also, you're using the system-defined, in-memory Configuration database in your connection string, so that won't cause any catalog creation.  The catalog will only be created when you try to open the actual database (one that is defined in the system Databases table).  Are you talking about the *configuration* file being created ?

Perhaps you can detail what you're trying to do, and I'll tell you how to do it.  None of this is any different than Delphi in terms of how things work.  The only difference is that one (.NET) uses a connection string for configuration/database properties, and the other (VCL) uses straight-up class properties for the same.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Jul 11 2016 4:26 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

>  Also, you're using the system-defined, in-memory Configuration
> database in your connection string, so that won't cause any catalog
> creation.

My apologies - I copied from the sample for simplicity, and not the
real code. I will try to put together a good sample of what I want to
do, and what isn't working.
Image