Check if a database exists

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

jfgeli
Posts: 72
Joined: Fri Jan 30, 2009 6:29 pm

Check if a database exists

Postby jfgeli » Wed Feb 05, 2014 9:46 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13317
Joined: Tue Sep 16, 2008 5:38 pm

Re: Check if a database exists

Postby EViews Gareth » Wed Feb 05, 2014 9:51 am

I think the only thing you can do is use the @fileexist function to check for existence of the database file.
Follow us on Twitter @IHSEViews

jfgeli
Posts: 72
Joined: Fri Jan 30, 2009 6:29 pm

Re: Check if a database exists

Postby jfgeli » Wed Feb 05, 2014 10:01 am

Works like a charm. Many thanks :)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 38 guests