Icon View Thread

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

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

I wrote a small database for myself and I use it with Client/Server connectivity. The database connects in both Windows 7 Pro and Windows 10 with no issues. I have always used an INI file and read from it in my data module create event. The INI file contains session type, remote port, remote host, remote address, database name and other connectivity information.

A friend wanted to use the application himself so I added code to connect to the local session in my data module OnCreate event (so as not to have to have him install the EDB server application on his laptop as well). The application starts up perfectly in Windows 7 but gives me an login dialog (I assume to be an EDB login dialog) in Windows 10 for some reason, which again does not occur when using Client/Server. Since his laptop is using Windows 10, I now have an issue.

The applicable local session code, which works in Windows 7, is shown below (any variables are from the INI file):
       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 Database Administrator.', mtWarning,[mbOK], 0);
               Application.Terminate;
           end;
         end;

I recall long ago about adding something like "DBLogin" (or something similar) to the uses clause of the data module but after much searching I could not locate any reference to it. Here's my data module uses clause, if it helps:
 SysUtils, Classes, ImgList, Controls, Dialogs, Forms, edbcomps, DB, RzCommon;

I don't understand why the connectivity would work fine with a local session on Windows 7 but not Windows 10  yet work fine with a remote session on Windows 10 (on my laptop).

Any assistance would be greatly appreciated.

Jan Ferguson
Thu, Feb 23 2017 5:36 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jan

I do something similar and I may be missing something (cos I'm ancient now) but I can't spot a problem with your code sample. Since its fine in W7 but not in W10 I suspect it may be something to do with permissions. W7 may allow you to write to C:\Users\Public\ but W10 requires you to go to one of the subdirectories. I don't know - just a guess.

The easy way to check out is to create a dedicated directory of your own, move things into it and see what happens.

I gave up years agp following the Microsoft mandated directories and have had a lot less trouble as a result Smiley


As typing just had another thought - where does the database point to? I've had the login prompt pop up when I've moved things.


Roy Lambert
Thu, Feb 23 2017 5:56 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Jan,

Where is the EDBConfig.EDBCfg file located?
Or perhaps you have more than one configuration files and you are using the wrong one.
Also, you can find the default login here:
http://www.elevatesoft.com/manual?action=viewtopic&id=edb2&product=delphi&version=7&topic=connecting_sessions

--
Fernando Dias
[Team Elevate]
Thu, Feb 23 2017 6:17 AMPermanent Link

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

Thanks Roy. I hoped that you would answer since I know you were the king of local sessions. Smile

I'm going to check out the permissions in W10. Since I was writing to the Users/Public I thought there would be no issues.

Regarding the database...here's the INI file info which shows where it's pointing to.
[Configuration]
DatabaseApplication=Medical
SessionType=Local
DataDirectory=C:\Users\Public\Medical\Data


Roy Lambert wrote:

Since its fine in W7 but not in W10 I suspect it may be something to do with permissions. W7 may allow you to write to C:\Users\Public\ but W10 requires you to go to one of the subdirectories. I don't know - just a guess.

As typing just had another thought - where does the database point to? I've had the login prompt pop up when I've moved things.
Thu, Feb 23 2017 6:25 AMPermanent Link

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

Fernando,

The EDBConfig.EDBCfg file is located in C:\Users\Public and this database is the the ONLY one referenced in my default local session. The database (Medical) was created in and is located in C:\Users\Public\Medical\Data. Like I wrote above...it works fine in Windows 7 but not in Windows 10. Additionally, when I use the SAME application on the SAME Windows 10 laptop but using a remote session, it also works fine. It's only when I use a local session on Windows 10 ONLY.

Only have one configuration file and it's located where I mentioned.

It's driving me buggers (also the reason I never use local sessions but only Client/Server (but then again...my clients are all government agencies or businesses which always use my commercial apps with Client/Server remote sessions.)

Fernando Dias wrote:

Where is the EDBConfig.EDBCfg file located?
Or perhaps you have more than one configuration files and you are using the wrong one.
Also, you can find the default login here:
http://www.elevatesoft.com/manual?action=viewtopic&id=edb2&product=delphi&version=7&topic=connecting_sessions

--
Fernando Dias
[Team Elevate]
Thu, Feb 23 2017 6:45 AMPermanent Link

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

I think I found the problem...Just waiting for Dropbox on my laptop to sync and I'll let you know. Fernando gave me a hint which might have turned into an "Aha" moment...
Thu, Feb 23 2017 6:54 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jan


I know you didn't show it but I assume you have code in there somewhere to alter the database if its not in C:\Users\Public\Medical\Data?

Another little thought just hit me - what happens in W10 if you use EDBManager to access the data locally? If that works its almost certainly somewhere in your code.

Roy Lambert
Thu, Feb 23 2017 7:02 AMPermanent Link

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

My thanks to Roy and Fernando. I figured out my issue, with a little nudge from Fernando.

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.

One I did that, it recognized the user login and password and all is working fine now. I guess I shouldn't continue to work into the late night hours on a critical task like setting up my installation. LOL!

It has never been an issue for me in the past because the configuration (catalog) files for client/server apps are included in the data folder. That's why I didn't think of including the configuration files in my installation in this instance.

Jan
Thu, Feb 23 2017 7:04 AMPermanent Link

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

I feel like such a dolt! Such an elementary mistake... Oh well...I'm getting old too Roy! Smile

Jan Ferguson wrote:

My thanks to Roy and Fernando. I figured out my issue, with a little nudge from Fernando.

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.

One I did that, it recognized the user login and password and all is working fine now. I guess I shouldn't continue to work into the late night hours on a critical task like setting up my installation. LOL!

It has never been an issue for me in the past because the configuration (catalog) files for client/server apps are included in the data folder. That's why I didn't think of including the configuration files in my installation in this instance.

Jan
Thu, Feb 23 2017 7:13 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jan


In my home/work from home LAN I have 2 W10 PCs & 2 W7. My normal workstation is a W7 laptop, my "server" is a W10 laptop. Remote / local connection from any of the PCs is fine (I've just tested local on the W10 server).

My ini file is

-----------------------------------------------
{C/S}NLH

{C/S}NLH
\\NLH\Work\TfR\
----------------------------------------------

My program only bothers about the first line so moving from local to c/s or vice versa means copy whichever I want to line 1

The data module OnCreate is

procedure Tdm.DataModuleCreate(Sender: TObject);
var
sl: TStringList;
begin
TfREngine.Signature := Copy(Digest(156), 1, 10);
TfREngine.TempTablesPath := GetWindowsTempPath;
edbParams.Sig := TfREngine.Signature;
edbParams.TempPath := TfREngine.TempTablesPath;
SetLocalRemoteDetails(TfRSession);
end;

and the bit that does the local vs remote is

procedure SetLocalRemoteDetails(WhichSession: TEDBSession);
begin
WhichSession.ExcludeFromLicensedSessions := True;
WhichSession.LocalTempTablesPath := edbParams.TempPath;
if edbParams.IsRemote then begin
 WhichSession.SessionType := stRemote;
 WhichSession.RemoteEncryptionPassword := edbParams.Encryption;
 WhichSession.RemotePort := 12010;
 WhichSession.RemoteSignature := edbParams.Sig;
 WhichSession.RemoteAddress := '';
 WhichSession.RemoteHost := edbParams.ConfigPath;
 WhichSession.RemoteEncryption := True;
 WhichSession.RemotePing := True;
 WhichSession.RemotePingInterval := 20;
end else begin
 WhichSession.SessionType := stLocal;
 WhichSession.LocalSignature := edbParams.Sig;
 WhichSession.LocalConfigPath := edbParams.ConfigPath;
 WhichSession.LocalEncryptionPassword := edbParams.Encryption;
end;
end;

The ini file is read in the program file BEFORE the application is inintialised

aPath := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)));
if FileExists(aPath + 'TfR.ini') then begin
 sl := TStringList.Create;
 sl.LoadFromFile(aPath + 'TfR.ini');
 if UpperCase(Copy(sl[0], 1, 5)) = '{C/S}' then begin
  edbParams.IsRemote := True;
  edbParams.ConfigPath := Copy(sl[0], 1 + Pos('}', sl[0]), MaxInt);
  cFound := True;
 end else begin
  cFound := FileExists(IncludeTrailingPathDelimiter(sl[0]) + 'EDBConfig.EDBCfg');
  if cFound then edbParams.ConfigPath := IncludeTrailingPathDelimiter(sl[0]);
 end;
 sl.Free;
end else cFound := False;

Its different to your's because I use encryption & the engine signature for data protection (recruitment so lots of peoples personal data). It works happily on W10&W7 in c/s & f/s modes.

The biggest difference to your code is that I store programs and data under \\NLH\Work\TfR\ or for c/s the local equivalent D:\Work\TfR. Any f/s stuff I always use UNC.


Roy Lambert
Page 1 of 2Next Page »
Jump to Page:  1 2
Image