How to change the database path

This is the place to post technical queries about SQL Yoga

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, trevordevore

Post Reply
ChrisSheffield
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6
Joined: Mon Apr 10, 2006 3:35 pm
Location: Idaho Falls, ID

How to change the database path

Post by ChrisSheffield » Tue Dec 10, 2013 5:01 pm

Hi Trevor (or whoever else responds),

I've had SQL Yoga working great in a stack that I now have to rename and move to a different folder, so I need to change the path to my database. This is for an iOS app, but I connect to the db in the IDE so that SQL Yoga is loaded and the database connection is available. So if I'm in the IDE, I set the path accordingly. It's that path I need to change. I tried changing it in my dbconn_set "file" call, but everything just went haywire (this is for a SQLite db, btw). I am saving the database object settings in a button. Is there something in those settings that also has to change? If so, what's the proper procedure?

Thanks,
Chris Sheffield
Chris Sheffield
Read Naturally, Inc.
The Fluency Company

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 873
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: How to change the database path

Post by trevordevore » Tue Dec 10, 2013 5:10 pm

To change the path to the database file you do want to set the "file" property of the database connection object. SQL Yoga will disconnect from the database prior to reassigning the path. So it sounds like you are dong the right thing. Can you define what "haywire" means?
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

ChrisSheffield
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6
Joined: Mon Apr 10, 2006 3:35 pm
Location: Idaho Falls, ID

Re: How to change the database path

Post by ChrisSheffield » Tue Dec 10, 2013 5:24 pm

Well, I feel foolish. :-) I tried this yesterday and couldn't get it to work. When I opened my stack after changing the path and saving, I couldn't get a valid connection and I was receiving an error about an object not being valid (I apologize; I don't have the exact wording). Anyway, I just tried it again and it's working fine. The only thing I can think of is that I used a bad folder name in my path or something.

So thanks for the quick response, and sorry for the bother.

Take care.
Chris Sheffield
Read Naturally, Inc.
The Fluency Company

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 873
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: How to change the database path

Post by trevordevore » Tue Dec 10, 2013 7:36 pm

Glad you got it working.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Post Reply

Return to “SQL Yoga”