[Gambas-user] Rename a file in filesystem

Paolo Fagni paolo.fagni at ...626...
Thu Jan 24 15:44:52 CET 2008


This is kind of an annoying problem. I post here the sub that I would like
to use to create a new sqlite file:  It doesn't work if, in the dialog, I
chosse a neme with a point in it ("xxx.db for example")

' Creates a new, empty, database.
PUBLIC SUB CreateNew() AS Boolean

  TRY dbConnection.Close()

  Dialog.Path = Application.Path
  Dialog.Title = ("Please choose a filename")
  IF Dialog.SaveFile() THEN RETURN
  DbPath = Dialog.Path

  IF Exist(DbPath) THEN ' Check if the file exists
    Message.Error(("File already exists!"))
    RETURN FALSE
  ENDIF

  dbConnection.Name = DbPath
  dbConnection.Type = "sqlite3"
  dbConnection.Open()

  dbConnection.Close()
END


Gambas fails with "Unable to locate database : /path/to/xxx.db

Gambas version 2.0.0 on an arch linux box.

Any help would be appreciated, Thank you! :D


-- 
Paolo Fagni



More information about the User mailing list