+1
Answered
Connect to remote SQL database
In your documentation, you show how to connect to a local SQL database, but how would you go about connecting to a remote SQL database? What types of credentials do you need?
Customer support service by UserEcho
I'm trying to do the same thing, but I'm have trouble getting it to connect. Here's what my code looks like:
<datasource name="favoritesdb-list" source="https://argyletesting:pass123@data.argyleapp.com/" query="SELECT * FROM a64744 ORDER BY NAME ASC;" providertype="sql"/>
But when I open the app, I get an alert saying "Database Error: no such table:a64744"
I know the 'a64744' table exists in the 'argyle' database at data.argyleapp.com, but I'm getting this error. I've also tried additional pathing like data.argyleapp.com/argyle and data.argyleapp.com/argyle/a64744, but nothing seems to work. (I'm also tried with 'http' and 'https'.) I'm a SQL noob, do you have any ideas what I'm doing wrong?
Tyler
Updated code:
<datasource name="favoritesdb-list" source="https://argyletesting:123pass@data.argyleapp.com/" query="SELECT * FROM a64744 ORDER BY NAME ASC;" providertype="sql"/>
This now appears to be the case. External SQL datasources can't connect through WIRE. Looks like you might have to take a different approach with JSON or onboard SQL
I could type up my SQL command to create the entire table and save it in an XML or JSON file, pass it through the WIRE, and have my internal SQL database query it (recreating the table locally). Does that sound like a terrible hack? Is there a better way to pass a remote-hosted string of text to WIRE?
Alternatively, can I tell my app to just download a remote file on command (it would be XML) and store it locally to be used as a datasource?
(Sorry for spamming your inbox, Doug!) :)
This tutorial maybe overkill for what you are trying to do:
http://www.raywenderlich.com/2941/how...