diff --git a/oscript-sql/DBConnector.cs b/oscript-sql/DBConnector.cs index a45a7d1..e17605b 100644 --- a/oscript-sql/DBConnector.cs +++ b/oscript-sql/DBConnector.cs @@ -228,27 +228,12 @@ public bool Open() { if (DbType == (new EnumDBType()).sqlite) { - string filePath = DbName; - if (filePath == string.Empty ) - { - filePath = ConnectionString; - } - else - { - ConnectionString = filePath; - } - _connection = new SQLiteConnection(string.Format("Data Source={0};", filePath)); - if (System.IO.File.Exists(DbName)) - { - return OpenConnection(); - - } - else - { - Console.WriteLine("Create db: " + DbName); - _connection.Open(); - return true; - } + if (ConnectionString == string.Empty && DbName != string.Empty) + ConnectionString = string.Format("Data Source={0};", DbName); + + _connection = new SQLiteConnection(ConnectionString); + + return OpenConnection(); } else if (DbType == (new EnumDBType()).MSSQLServer) {