From: "Mark Edington (Borland)" Subject: Re: DataLinkDir - what is it? Date: 15 Dec 1999 00:00:00 GMT Message-ID: <838qdo$j0727@forums.borland.com> References: <835hu7$oj69@forums.borland.com> <836e14$vb29@forums.borland.com> <8382ep$ft87@forums.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Inprise Corp. X-MSMail-Priority: Normal Newsgroups: borland.public.delphi.database.ado Bill Cart wrote in message news:8382ep$ft87@forums.borland.com... > I saw somewhere that Windows 2000 has removed the DataLink from the right > click menu. Does this suggest that MS is trying to get away from using them? No I don't think they are trying to get away from using them. I think they just felt that the right click option was too hidden. I don't really know the whole story. Anyway, datalinks are definitely useful. > Did you mean that the best way for the program to know where the data is > might be to use (for example) a text file and just modify the contents of > that? Then the program would read this file on startup? I guess that the > setup location could go into the registry but I prefer to avoid using the > registry whenever possible. As I see it, the main advantage to using a DataLink file is that the connection information is completely separated from the executable program. This would be desireable if you wanted to allow the location of the data to be changed on the fly. The disadvantage is that you now have to deal with a separate file and making sure you know how to find it. The DataLinkDir helps facilitate that by returning the path to the default storage location. If you are writing an application that is using a local data file (such as an Access .MDB file) which is stored in location that is relative to the executable path the the simpliest solution might be to just dynamically create the connection string at runtime. Something like this: ADOConnection1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+ExtractFilePath(ParamStr(0))+'mydata.mdb'; This will configure the connection to always look for the database in the same directory as the program executable. Mark