In connection with the discovery of the sqlite database in Delphi, I began to consider the types of input parameters. I changed the code
procedure TMainWindow.OpenDialog1Close(Sender: TObject); begin partofconnectstring:=ExtractFilePath(String(OpenDialog1.FileName))+ExtractFileName(String(OpenDialog1.FileName)); Label1.Caption:=partofconnectstring; Edit1.Text:=partofconnectstring; ConnectToDatabase(partofconnectstring, SQLConnection1); CreateObjs(SQLConnection1, DBSchema); //IBDatabase1.DatabaseName:='127.0.0.1:'+ChangeFileExt(OpenDialog1.FileName, '.fdb'); end;
Since in the ConnectToDatabase
procedure the input parameter is string
, the question arises how to convert OpenDialog1.FileName
to string
, since the above code does not work. When debugging, partofconnectstring
displayed as an empty string.