Path to database

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: Path to database

Post by redfield » Sun Sep 29, 2019 6:30 pm

Well through this script

Code: Select all

on openStack
   put specialfolderpath("home") & "/newfolder" into targetFolder  
   if there is not a folder targetFolder then
      create folder specialfolderpath("home") & "/newfolder"
   end if
   put specialfolderpath("resources") & "/db_test" into tSourceFile
   put specialfolderpath("home") & "/newfolder/db_test" into tTargetFile 
   if there is not a file tTargetFile then
      put URL("binfile:" & tSourceFile) into URL("binfile:" & tTargetFile)
   end if
end openStack
there was actually a database file but it was empty and contained no tables. Now with the 'Copy file' setting, the database file with all its tables is available.

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Path to database

Post by Klaus » Sun Sep 29, 2019 6:36 pm

Okie Dokie!

Save some more typing by "re-using" variables:

Code: Select all

on openStack
   put specialfolderpath("home") & "/newfolder" into targetFolder  
   if there is not a folder targetFolder then
      create folder targetFolder
   end if
...
:D

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: Path to database

Post by redfield » Sun Sep 29, 2019 7:58 pm

Good point - should be even obvious for a beginner like me :|

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Path to database

Post by bogs » Sun Sep 29, 2019 8:57 pm

Don't take it so hard redfield, after you reach 11 million posts like Klaus has, I'm sure whose a beginner or not starts to blur.... :twisted:
Image

Post Reply

Return to “Databases”