diff --git a/source/exportsql.pas b/source/exportsql.pas index 572c59ad..c2d54ca0 100644 --- a/source/exportsql.pas +++ b/source/exportsql.pas @@ -278,7 +278,7 @@ begin Height := GetRegValue(REGNAME_EXP_WINHEIGHT, Height); if EditFileName.Text = '' then - EditFileName.Text := ExtractFilePath(paramstr(0)) + 'export.sql'; + EditFileName.Text := DirnameUserAppData + goodfilename(Mainform.ActiveDatabase + '.sql'); // Tell the user how to use the table pattern EditFileName.Hint := 'Usage for generating one file per table: c:\foo\bar_'+TABLENAME_PATTERN+'.sql'; diff --git a/source/main.pas b/source/main.pas index 1b92f2a3..ac983465 100644 --- a/source/main.pas +++ b/source/main.pas @@ -1320,6 +1320,8 @@ begin // User folder for HeidiSQL's data (\Application Data) DirnameUserAppData := GetShellFolder(CSIDL_APPDATA) + '\' + APPNAME + '\'; + // Ensure directory exists + ForceDirectories(DirnameUserAppData); // Folder which contains snippet-files DIRNAME_SNIPPETS := DirnameCommonAppData + 'Snippets\';