Page 1 of 1

Check if a database exists

Posted: Wed Feb 05, 2014 9:46 am
by jfgeli
Hi there,

I am creating a routine to update a database. However, I want the routine to check if the database exists first. If the database exists, it will need to create it and if the database does not exist, only to update its content. My problem is that I do not know how to test before hand if the database already exists. I would be grateful to any suggestion.

Cheers,

Fede

Re: Check if a database exists

Posted: Wed Feb 05, 2014 9:51 am
by EViews Gareth
I think the only thing you can do is use the @fileexist function to check for existence of the database file.

Re: Check if a database exists

Posted: Wed Feb 05, 2014 10:01 am
by jfgeli
Works like a charm. Many thanks :)