Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Workstation can see the databases, but not the tables
Tue, Dec 22 2009 3:11 AMPermanent Link

Peter
Hello

EDB 2.03(B4) on Delphi 7.

I have a non-CS app (SessionType = stLocal) that works great on one PC at at time, but I cannot get it to run on a Vista workstation that is using a
LAN to see the database, which uses XP.

Specifically, the app running in XP uses an INI file that is in C:\Documents and Settings\All Users\Application Data\MyApp, and the MyApp.INI
contains the line EngConfigPath=C:\Documents and Settings\All Users\Application Data\MyApp\; the INI file is in the same folder as the config
files.

On the Vista machine the INI is in c:\ProgramData\Myapp, and has the line EngConfigPath=\\BLACKIE\MyApp\ - which is the name of a share on
the XP box. I have also tried sharing the entire drive on the XP box, and the EngConfigPath was set to \\Machine\Share\ Documents and
Settings\All Users\Application Data\MyApp\,  but the results are the same.

MyApp also has 3 folders which are under C:\Documents and Settings\All Users\Application Data\MyApp\, which are \ProductionData,
\TrainingData & \MyStore. From the XP machine all these folders are visible from EDB Mgr, though with the names that each has been given when
they were created of course.

From Vista, I set the permissions for all the files in and under \\BLACKIE\MyApp\ to Full control.

The problem is that when MyApp is run from Vista, it fails to find the data tables. I installed EDB Mgr on the Vista machine, pointed the Default
session to \\BLACKIE\MyApp\ by editing the session's File folder value, in the Local configuration tab. The two databases and the Store are all
visible, but there are no contents.

How can I resolve this minor setback?

Regards

Peter
Tue, Dec 22 2009 10:53 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Peter


Try setting all the paths (especially those for the databases) using UNC notation rather than local.

Roy Lambert [Team Elevate]
Tue, Dec 22 2009 11:57 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Peter,

<< The problem is that when MyApp is run from Vista, it fails to find the
data tables. I installed EDB Mgr on the Vista machine, pointed the Default
session to \\BLACKIE\MyApp\ by editing the session's File folder value, in
the Local configuration tab. The two databases and the Store are all
visible, but there are no contents. >>

What path names are used for the defined databases and stores ?  Also, can
you see the edbdatabase.edbcat file in the database directory from the Vista
machine ?  If so, what does the permissions look like for the file from the
Vista machine ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Dec 22 2009 9:32 PMPermanent Link

Peter
Tim & Roy

<<What path names are used for the defined databases and stores ?>>

I did as Roy suggested and changed the database & store paths to UNC, and everything works across the network, thanks.

However, I did that by copying the UNC path from Windows Explorer on the remote machine, and using the EDB Mgr's Alter database dialog, &
pasting it into the Database folder edit.

The next problem is in getting that UNC path programmatically, to insert into the CREATE TABLE statement, and keeping in mind that the
installation will be on one machine in the P2P network, therefore the WNetGetUniversalName, WNetGetConnection and Delphi's
ExpandUNCFileName all appear to return the same path as is input, when referring to the local machine.

i.e. 'C:\AppData\MyApp\' returns 'C:\AppData\MyApp\', whereas I want '//MACHINEName/ShareName/AddData/MyApp/'.

Is there a trick API call that I can use to assemble the UNC path of a folder on the current machine?

Regards

Peter
Wed, Dec 23 2009 4:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Peter


These posts from the codegear ngs may help. One of them was started by myself, but I don't think I ever solved it. I just use a manually created .ini holding the path

---------------------------------------------------------------------------------------------------

>Is there a function to convert a local path (eg D:\NLHEMail) to its UNC equivalent (eg \\Base\Work\NLHEMail).
>
>For some unknown reason my XPHome server has just decided to be "helpful" and translate the file paths for email attachments received to the local rather than the unc path thus preventing me reading them easily over the network.

No but.
http://www.tek-tips.com/viewthread.cfm?qid=653552

---------------------------------------------------------------------------------------------------

In article <43da3376$1newsgroups.borland.com>, Brian wrote:
> I have a file on a server whose local path name is:
>
> C:\MySharedFolder\MyFile.txt
>
>
> Where MySharedFolder is shared.
>
> I want to pass the file name to client applications so that they can then
> access the file via the share. As far as I know, I need to pass the filename
> in the UNC form:
>
> \\MyServer\MyShareDrive\MySharedFolder\MyFile.txt
>
> How can I convert the local name of my file to a form I can give to the
> clients?

If the shares name is the same as the folder name you would just substitute
the drive letter + colon with the computers network name. You can get the
latter via the GetComputername API function:
function Computername: string;
var
 buffer: array[0..MAX_COMPUTERNAME_LENGTH] of char;
 len: DWORD;
begin
 len := Sizeof(buffer);
 GetComputername(buffer, len);
 Result := buffer;
end;

If the share name is not the folder name and you don't know it up front you
would have to enumerate the shares on the PC to find which one is mapped to
that folder. There are API functions for that as well (NetShareEnum,
NetShareGetInfo, cave platform differences!). I think Colin Wilsons website
has some wrapper classes for this stuff, see
http://www.wilsonc.demon.co.uk/delphi.htm
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be




Roy Lambert [Team Elevate]
Wed, Dec 23 2009 6:00 AMPermanent Link

"Malcolm"
My main app also has to operate in either stand alone or P2P, so I
had the same problem.

My solution builds on my suite already using UDP broadcasting to
exchange data and alerts over the LAN.

So, my users can designate one or more instances of the main app to
be a 'server'.  Potential 'clients' wanting to connect to the
database simply broadcast a UDP packet asking any servers to reply.
The 'servers' reply including their '\\hostname\sharename'.  The
client waits for 3 seconds to allow any sleepy/busy servers to
respond, then populates a radio group box with the list of UNC paths
received.  (I also provide for the hostname to be replaced with the
IP address when needed.

--
Wed, Dec 23 2009 6:48 AMPermanent Link

Peter
Roy

If Peter Below can't answer the question unequivocally (because there may be multiple shares involving that folder) then I have no hope Smile

I can't test it right now, but when the user is installing the minimal workstation files (an INI and a shortcut to the exe on the server) they could also
browse to the location of the cat files (always \ProgramData\Myapp or it's equivalent in XP) then we can use that string to do an ALTER DATABASE
on the server. Can't we? I know that I can't see the tables, but as I can 'see' the databases (but not their path's) I am hoping that I can still run the
ALTER DATABASE.

Malcolm, my UDP knowledge is very limited (I'm not even sure how it is spelt), so I'll run the above idea first & see how I go.

Thanks for your help.

Regards

Peter
Wed, Dec 23 2009 9:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Peter


It was a problem I first encountered with D1 with (I think) W95. I must have spent days going round in circles trying to figure out what was happening and eventually found that Windows was being "helpful" and the UNC I'd specified was being converted to a local path before storing. Everything worked fine on one PC .......

Roy Lambert
Image