realbasic-nug
[Top] [All Lists]

Re: Mac RealSQLDatabase connections in a network shared folder

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Mac RealSQLDatabase connections in a network shared folder
From: "Peter E. Barck" <peb at tablesofcontent dot com>
Date: Tue, 28 Feb 2006 13:04:58 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <A9ACC4BC-B21C-4BC0-945E-FAEAB0F8B747 at stretchedout dot com>
On Feb 28, 2006, at  12:22 AM, Greg wrote:

I'm creating a desktop app for helping with my daily billing tasks and wanted to use RealSQLDatabase (RB2006 Mac OS X 10.4.5). Everything runs fine if I run the app on my local computer (the database file is stored in the folder with the app), but if I transfer the app and the database file to our Mac OS X 10.4.5 Server, I get an error when trying to connect to the file about the database being locked. I can tell you that the file is not locked, I can run the app by going to the server, logging in as me, and the db opens just fine. My code looks like this:

If I read you correctly: You have the Database and your application on a Server. You are on another machine on your network and you run your application. You must have a copy of your application on your machine, which is running there, not the one on the server. You cannot run a remote application on your machine without using such facilities as Apple's RemoteDesktop.

Without using the Volume designation in the GetFolderItem your application will not find the remote database.

To make this work, you first need to obtain the Volume # of your mounted sever volume. Then

   f =  Volume(x).Child(your db folder on the server).child("backend.rsd")

  This works quite well. I do this all the time.
   Cheers,
   Peter

    TI PowerBook G4, 1GHz, 1GB RAM, OSX 10.3.9, RB2006r1 Pro



Function connectdb() As boolean
  dim f as FolderItem
  dim tf as Boolean
  db = new REALSQLDatabase

f = GetFolderItem("").child("backend.rsd") 'File will always be located in the directory with the app
  if f<>nil then
    db.DatabaseFile = f
    if f.Exists then 'If it exists, use it
tf = db.Connect() '<----------- TF SET TO TRUE IF THE DATABASE FILE IS LOCATED ON OUR SERVER.
      return tf 'Doing it this way so we can look at the error code
    else 'if not, create a new one
      return db.CreateDatabaseFile()
    end if
  else
    return false
  end if
End Function

This code works just fine on Windows XP to the same server (using Apple's SMB sharing).

Anyone seen this? Workarounds? Help?

Greg

P.S. - I also tried running the app locally, connecting to the database in the remote directory. No Dice.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


--
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>