Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 13 of 13 total
Thread Login dialog in Windows 10
Thu, Feb 23 2017 7:15 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jan


>My configuration file WAS in the C:\Users\Public folder but it was "created" by the application but without the pertinent user and other data. I had forgotten to include the configuration files from my development computer (located in the C:\Users\Public folder) in the installation.

Been there, done that, forgot all about it Smiley

Roy
Thu, Feb 23 2017 7:31 AMPermanent Link

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

Roy...

I like yours as well. Mine looks like this... (I never usually include local session information since I almost entirely use C/S sessions, so I probably could clean this up and eliminate the duplicate opening of tables, etc. but I just copied and pasted the code for the ease of making a version quickly for my friend.)

procedure TdmMedical.DataModuleCreate(Sender: TObject);
var RemoteAddress: String;
   RemotePort: String;
   RemoteHost: String;
   SessionType: String;
   RemoteDataDirectory: String;
   DataDirectory: String;
   DatabaseApplication: String;
   FileName: String;
begin
EDBEngine.Active := False;
FileName := 'NetConfig.ini';
if FileExists(FileName) then
 begin
   with ConfigIni do
     begin
     DatabaseApplication := ReadString('Configuration','DatabaseApplication','DatabaseApplication');
     RemoteAddress := ReadString('Configuration','RemoteAddress','RemoteAddress');
     RemotePort := ReadString('Configuration','RemotePort','RemotePort');
     RemoteHost := ReadString('Configuration','RemoteHost','RemoteHost');
     SessionType := ReadString('Configuration','SessionType','SessionType');
     RemoteDataDirectory := ReadString('Configuration','RemoteDataDirectory','RemoteDataDirectory');
     DataDirectory := ReadString('Configuration','DataDirectory','DataDirectory');
     end;
   if SessionType = 'Remote' then
     begin
     dsMedical.RemoteAddress := RemoteAddress;
     dsMedical.RemotePort := StrToInt(RemotePort);
     dsMedical.RemoteHost := RemoteHost;
     dbMedical.Database := DatabaseApplication;
       try
         dsMedical.Connected := True;      //Connect remote session
         dbMedical.Connected := True;      //Connect remote database
         tblBills.Active := True;
         tblPatient.Active := True;
         tblPayType.Active := True;
         tblProvider.Active := True;
         tblType.Active := True;
         tblConfigure.Active := True;
         tblAGI.Active := True;
         tblReportBills.Active := True;
       except
           MessageDlg('Cannot connect to the Server! This might be caused by one of the following reasons:' +
           #10#13#10#13 + '1. Your network connection is not active' +
           #10#13 + '2. The server is undergoing maintenance updates' +
           #10#13 + '3. The server is not accepting new connections in preparation for maintenance updates' +
           #10#13 + '4. You have changed the network settings incorrectly in the configuration file' +
           #10#13#10#13 + 'Please try again in 15-30 minutes. If your network connection is active '+
                     'and you still cannot connect to Medical, please notify your System Administrator ' +
                     'or Database Administrator.', mtWarning, [mbOK], 0);
           Application.Terminate;
       end;
   end else
       if SessionType = 'Local' then
         begin
         dsMedical.SessionType := stLocal;
         EDBEngine.UseLocalSessionEngineSettings := True;
         dsMedical.LocalConfigPath := 'C:\Users\Public\';
         dsMedical.LoginUser := 'XXXX';
         dsMedical.LoginPassword := 'XXXX';
         dbMedical.Database := DatabaseApplication;
           try
             dsMedical.Connected := True;
             dbMedical.Connected := True;
             tblBills.Active := True;
             tblPatient.Active := True;
             tblPayType.Active := True;
             tblProvider.Active := True;
             tblType.Active := True;
             tblConfigure.Active := True;
             tblAGI.Active := True;
             tblReportBills.Active := True;
           except
               MessageDlg('Cannot connect to the Server! Please notify your System Administrator ' +
                         'or Database Administrator.', mtWarning, [mbOK], 0);
               Application.Terminate;
           end;
         end;
 end;
end;
Thu, Feb 23 2017 8:40 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Jan,

I'm glad you have found it, and hey... don't feel like that - after all "the devil is in the details", most of the times the simple ones Smiley

--
Fernando Dias
[Team Elevate]
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image