Page 1 of 1

Postgres SQL Server

Posted: Fri Jan 04, 2019 8:06 pm
by Quinton B.
Good evening. I was originally using MySQL, but it would crash all the time, so I moved to Postgres SQL.
But I'm unable to connect to the server via my mobile device, however, I can do so locally.
Could someone walk me through how to connect my test app?

Code: Select all

   
   global gConnectionID
    put revOpenDatabase("postgresql", xxx.x.x.x, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
	
	-- check if it worked and display an error message if it didn't
	-- & set the connection ID global
	if tResult is a number then
		put tResult into gConnectionID
		answer info "Connected to the database." & cr & "Connection ID = " & gConnectionID
	else
		put empty into gConnectionID
		answer error "Unable to connect to the database:" & cr & tResult
	end if  
For clarification, I can connect to the database while executing the above code in the native livecode environment. But I'm not able to connect to the database once it's placed on a standalone app for Android.

Re: Postgres SQL Server

Posted: Fri Jan 04, 2019 9:44 pm
by Quinton B.
I believe it's something with the SQL software. I need to find out how to change it from local Host to a set IP address with a password in which a user can connect to.

Re: Postgres SQL Server

Posted: Fri Jan 04, 2019 11:51 pm
by ghettocottage
You probably need to open up the server to allow connections from whatever IP you are at, or open it up to any connections (not safe).

phpPGAdmin might make things easier for managing your users and allowed connections:
http://phppgadmin.sourceforge.net/doku.php

Re: Postgres SQL Server

Posted: Sat Jan 05, 2019 12:39 am
by Quinton B.
I have pgAdmin4, its what I'm currently using. I've tried many things that websites have said to allow remote connection. None of which work.

Re: Postgres SQL Server

Posted: Sat Jan 05, 2019 6:08 am
by ghettocottage
sorry, I re-read your original post where you said you were able to connect to the database when working in LC, which means I am off-base. Your database is probably configured for incoming connection correctly.

Does your app work if you save it as a stand-alone desktop app?

Re: Postgres SQL Server

Posted: Sun Jan 06, 2019 12:25 am
by Quinton B.
The app's functions that are not tied into the database will run, however, I'm unable to connect to it via the app.

Re: Postgres SQL Server

Posted: Sun Jan 06, 2019 2:12 am
by jacque
It sounds like there's a missing inclusion, but I'm not sure what you mean by "running locally". Do you mean it runs in the IDE? If so, the IDE has all the inclusions loaded at all times. If you mean something else by "locally" then I'm stumped.