Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 4 of 4 total |
Checking for created database |
Sat, Sep 8 2012 9:51 PM | Permanent Link |
Colin Wood VirtualTec P/L | Hi Guys,
Could someone please tell me what is the best way to check for an existing database? When I use MainFrm.FDASession1.Execute('CREATE DATABASE "FDADb" PATH ' + Quote('c:\fda\data') + ' DESCRIPTION ''FDA Database'''); it sometimes already exists, and I get the warning message. Is there something similar to checking for tables by using if (Execute('Select * From Information.Tables '+ 'Where Name='+Engine.QuotedSQLStr('Prefs'))=1) then... but for the database instead, or should some code be placed in the "before connect" of the database? Thanks Colin |
Sat, Sep 8 2012 10:49 PM | Permanent Link |
Raul Team Elevate | You can query the configuration database. something like :
SELECT * from Configuration.Databases where Name='<your db name>' If this returns data then db exists Raul On 9/8/2012 9:51 PM, Colin Wood wrote: > Hi Guys, > Could someone please tell me what is the best way to check for an existing database? |
Sun, Sep 9 2012 3:23 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Colin
And if you follow up Raul's suggestion with a FileExists tests for the catalog file it will tell you if the database really exists on the harddrive. Only needed if you're paranoid or someone messes with your system Roy Lambert [Team Elevate] |
Sun, Sep 9 2012 3:31 AM | Permanent Link |
Colin Wood VirtualTec P/L | Thanks Raul and Roy. Paranoia comes naturally!
|
This web page was last updated on Tuesday, May 7, 2024 at 06:25 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |