problem opening remote database
Charles Yeomans
yeomans at desuetude.com
Thu Dec 29 16:54:10 CST 2005
Even after replacing the corrupt files, I was still encountering the
same problem -- I could open the database, but it had 0 tables. This
problem I can reproduce, and it's interesting.
Here is my code:
dim newDB as new VDatabase(serverAddress, userName, password)
dim dbFile as new FolderItem("timedatabase")
newDB.Open dbFIle
This looks like it should work, but it didn't. The problem turns out
to lie with dbFile. When you create a new FolderItem in REALbasic like
this, it assumes that the FolderItem is in the same directory as the
application. In that directory, I had a folder called "TimeDatabase".
So the result, dbFile, was a FolderItem pointing to that directory. I
suspect that V4Rb looks at the FolderItem passed to Open, sees that it
is a directory, and does something with that information. But of
course "timedatabase" is not a directory on the server machine.
Renaming that directory on my machine cured the problem, and I was able
to get a working VDatabase object.
It seems to me that the best solution is that VDatabase.Open should be
overloaded to accept a String parameter for remote databases. Given
that VDatabase already has different constructors for local v. remote,
I don't think that overloading Open and Create would take us too far
away from the goal of a single codebase for working with local and
remote databases.
--------------
Charles Yeomans
More information about the Valentina
mailing list