Postgres SQL Server

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Postgres SQL Server

Post by Quinton B. » Fri Jan 04, 2019 8:06 pm

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.

Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Re: Postgres SQL Server

Post by Quinton B. » Fri Jan 04, 2019 9:44 pm

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.

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: Postgres SQL Server

Post by ghettocottage » Fri Jan 04, 2019 11:51 pm

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

Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Re: Postgres SQL Server

Post by Quinton B. » Sat Jan 05, 2019 12:39 am

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.

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: Postgres SQL Server

Post by ghettocottage » Sat Jan 05, 2019 6:08 am

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?

Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Re: Postgres SQL Server

Post by Quinton B. » Sun Jan 06, 2019 12:25 am

The app's functions that are not tied into the database will run, however, I'm unable to connect to it via the app.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Postgres SQL Server

Post by jacque » Sun Jan 06, 2019 2:12 am

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”