Strange path after the Save As Dialog

RUNNING IN THE IDE.

I do not worked on this part recently, but I am starting gettings error cannot create the database file.

After sometimes, I noticed that if I change the default name, say, change 0 with 1 to not erase the previous value, I get the problem.
If I put a different name, the problem does not exists.

The problem is below: (two times the same part of string: the previous file name as if it is a folder, and the new file name)

Downloads:Twin Earths:Twin Earths - Daily Strips - Index-0.sqlite:Twin Earths - Daily Strips - Index-0.sqlite

Of course, the db engine does not like that and db.CreateDatabaseFiel fails (MsgBox issued in the example below).

db.DatabaseFile = f If db.CreateDatabaseFile Then / /proceed with database operations... Else MsgBox("Database not created. Error: " + db.ErrorMessage) End If

The FolderItem is not Nil.

The error message is:

The Database was not created. The error is: unable to open database file.

I do not know why… Ideas ?

A previous application (from 01-27, downloaded back from internet…) works fine :frowning:

What does NativePath property show after save as dialog?
What is your code for Save dialog?

Hi Christian,

Nothing fancy:

If gOpenSQLite_FI <> Nil Then SQLite_SaveDlg.InitialDirectory = gOpenSQLite_FI Else SQLite_SaveDlg.InitialDirectory = SpecialFolder.Documents End If SQLite_SaveDlg.promptText = "Please, set a name and select a location for it" SQLite_SaveDlg.SuggestedFileName = Self.Title + ".sqlite" SQLite_SaveDlg.Title = "Save the data into a Data Base File" SQLite_SaveDlg.Filter = FT_IO.SQLite SQLite_SaveFI = SQLite_SaveDlg.ShowModal() If SQLite_SaveFI = Nil Then MsgBox "Save the List in a Data Base" + EndOfLine + EndOfLine +_ "Did you press Cancel ?" Return End if

I set a breakpoint after that code (in an added Beep line), then added a MsgBox SQLite_SaveFI.NativePath and I get what I report above.

When I change one character in the file name (in the Save As Dialog), the file name keeps the same width, the new file name is appended (how ? Not me) after the first one after a field (folder) separator is added…

When I type a brand new file (different length), the file is created and populated (an SQLite file).

I do not had the chance to compile the project from a fresh boot / no other running application.

The only change done in this part of the source was done many days before a compile that works (I keept that one).

I prefer to heck against an error of mine istead of sending the bug to others, but clearly, in this case, I think it is Xojo’s fault.

I already get something strange like that in pdf printing (macOS): a path is added in the file name (Save as PDF)… but this does not stop the save process, so…

self.title contains what?

maybe you better check if that contains special characters and strip \, : and / in advance.

Hi Christian,

already done.

I shut down my computer two times and one for two hours or so. Watched TV, have diner, etc.

Then, I stand up from bed (near noon now) and search for a previously saved project version.

I found one from 5 days ago, move it from the backup folder to the main project folder, open it, check the code (no write at all), same code (not modified in the latest project), run it and it works fine.

Another example of friendly Xojo.

Thank you Christian for the help, the trouble is in Xojo (or in Xojo running my MBP).

My next move was to copy the project in a MemoryStick and run it on my Windows laptop (just in case it behave differently.

The last planned action was to delete the Xojo folder from my system file (the one where the help db file resides…). This was successful for my inability to build applications that I had during the last Black Friday.

How to make a software when one undergoes such things?
(many times a month…)

I only add the following lines just below my two (or three) Dim lines, before the SaveAsDialog code:

MsgBox "Self.Title + “.sqlite”" + EndOfLine + EndOfLine +_ "[" + Self.Title + ".sqlite]"

And the software works fine.

If I comment these lines, the bug reappears…

Also, the displayed text (Self.Title + ".sqlite" used to fill the new file name suggestion property is correctly reported in thhe MsgBox.

Did I told you lately there was something strange there ?

Adding:

Beep Beep Beep Beep Beep Beep Beep Beep Beep Beep Beep Beep Beep Beep

and commenting the MsgBox lines does the trick too…