Error while running the application on another computer

Asked

Viewed 255 times

3

I developed an application that when running in my computer the same runs normally but when trying to run the same application in other equipment the following error appears and I can’t access the database:

inserir a descrição da imagem aqui

Note: I already copied all the dll’s that are next to my project to the computer, I also copied the dbxconnections.ini and dbxdrivers.ini files but the error persists if you have any idea

inserir a descrição da imagem aqui

Postgresql version is 9.6.0

And the content of Dbxconnection is:

[Devart PostgreSQL]     
BlobSize=-1                     
HostName=192.168.1.130                          
DataBase=BancoDados                          
SchemaName=                               
DriverName=DevartPostgreSQL                            
User_Name=postgres                      
Password=masterkey                         
FetchAll=True                   
UseQuoteChar=False                        
EnableBCD=True                     
ServerCharSet=  

Configuration Dbdrivers:

[Devart PostgreSQL]                                    
GetDriverFunc=getSQLDriverPostgreSQL                         
LibraryName=dbexppgsql.dll                  
VendorLib=dbexppgsql.dll                  
Database=BancoDados                 
User_Name=postgres                
Password=masterkey                  
ServerCharSet=                         
BlobSize=-1                    

[AutoCommit]                    
False=0                    
True=1

[BlockingMode]                     
False=0                  
True=1

[WaitOnLocks]                       
False=1                           
True=0

[CommitRetain]                              
False=0                        
True=1

[OS Authentication]                              
False=0                          
True=1

[Multiple Transaction]                         
False=0                          
True=1

[Trim Char]                            
False=0                            
True=1

[DB2 TransIsolation]                                
DirtyRead=0                           
ReadCommited=1                              
RepeatableRead=2

[Interbase TransIsolation]                                         
ReadCommited=1                           
RepeatableRead=2

[Oracle TransIsolation]                       
DirtyRead=0                       
ReadCommited=1                                           
RepeatableRead=2

[Informix TransIsolation]                            
DirtyRead=0                          
ReadCommited=1                              
RepeatableRead=2

[MSSQL TransIsolation]                               
DirtyRead=0                 
ReadCommited=1                             
RepeatableRead=2

[SQLDialect]                                        
1=0                                  
2=1                                                
3=2

Code:

procedure TdmDatabase.DataModuleCreate(Sender: TObject);
begin
  SQLConnection.Connected := false;
  SQLConnection.LoadParamsOnConnect := true;
  SQLConnection.AutoClone := false;
  SQLConnection.LoginPrompt := false;
  SQLConnection.LoadParamsFromIniFile('dbxconnections.ini');
  //SQLConnection.LoadParamsFromIniFile('LOCAL_dbxconnections.ini');
  SQLConnection.Connected := true;
end;
  • 1

    The SQLConnection is disabled, and it will only be enabled when opening the system, configuring the database correctly? Or maybe you forgot the connected component, generating the error...

  • @Andrey It is the SQL Connection would open only inside the application, in which case I would have to open it from the beginning alone?

  • I think my comment got a little confused even, the right thing is to just connect it when opening the application. link

  • @Andrey because it is I tried to do what the link suggested but the error persisted

  • The bank is FireBird? Is it installed on the machine? You may need to copy the FBClient.dll

  • The database is Postgresql, and the database is only installed on my machine, so when I try to open the application on another machine the error message occurs, on my machine the error does not occur

  • @Andrey I identify the database in the sql Connection component where I place the IP from where the database is installed, that would be right enough?

  • If possible, please post the connection routine with the database, and the contents of dbxconnection. And also inform which version of Postgresql you are using ?

  • @Victorzanella I edited the question with the information you requested

  • @Victorzanella I also put as this configured the Dbxdrivers, I believe this also has importance

  • Please post the code part of your application where you connect the component to the bank. Ex.: SQLConnection.Connected := True. Post all the block where you do the above operation.

  • @Andrey I edited the question with the part you asked

  • Strange that you didn’t put the port, and it worked. Have you tried to put the default port on the Host? Ex.: Hostname=192.168.1.130:5432

  • Would that be just on Dbxconnection.ini @Victorzanella? As I edited the file only however the error persists on another computer, name worked normally

  • I can’t tell you for sure. because Voce implements the parameters in Design Time, Runtime and Dbxconnection. You should only use one of them. For the test, put in Designtime and Dbxconnection

  • @Victorzanella I edited in the places you commented and the mistake became: dbExpress Error: Invalid Username/password That’s when I try to access on another computer

  • It seems to me (I’m not sure) that your user and password are the standards of postgresql. I suggest you change this as soon as possible. To continue testing, it removes the Username and password from Dbxconnetion and the Sqlconnection component. If this does not work, try to change the user and password of the bank, and just put it in the code. Bank Password can never stay in an open file like dbxconnection.

Show 13 more comments

2 answers

3

I noticed the property LoadParamsOnConnect is true in your code. Remove the line that assigns the value to property and change the component to false:

  SQLConnection.LoadParamsOnConnect := false;

Also make sure that the file dbExpint.dll is in its application and that the midas is registered.

3


I was able to solve the error after the assistance of the comments and also through the help of the user @Sorack, summarizing needed to change the file settings pg_hba.conf and add a Firewall entry rule to port 5432, so I was able to access the application from other computers

Changing the pg_hba.conf file:

I added the following line: host all 0.0.0/0 trust

  • only do not forget to take out the dbxconnection database password. : D

  • @Victorzanella Ah ta right, thanks for your help

Browser other questions tagged

You are not signed in. Login or sign up in order to post.