Article View: borland.public.cppbuilder.database.ado
Article #1922Re: ConnectionString
From: Dwayne
Date: Sun, 18 Jan 2004 22:15
Date: Sun, 18 Jan 2004 22:15
22 lines
1709 bytes
1709 bytes
Andreas>>how can I set the path and db-name not at designtime in the
connection ting but dependent to the installation where the user can choos
where to copy the database in his system. <<
A simple and easy way, is to use a INI file. then you only have
to change the INI file to direct it anywhere you want.
AnsiString Buf1;
TIniFile* pif = new TIniFile("\\Programs/fileloc.ini");
Buf1 = pif->ReadString("INVOICE", "invoice", "invoice");
Form1->Invoice->Active=false;
Form1->Invoice->TableName=Buf1+".dbf";
Form1->Invoice->IndexName=Buf1+".ndx";
Form1->Invoice->Active=true;
delete pif.
inifile is something like...
[INVOICE]
Invoice=c:/invoice/invoicefiles
Dwayne
Technical Details
Message-ID:
<400c3999@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mailReferences:
<bu8p44$ea1k7$1@ID-215342.news.uni-berlin.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,3aba1eaf96bc1326 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-01-19 12:17:00 PST Reply-To: "Dwayne" <myfrienddr@yahoo.com> From: "Dwayne" <myfrienddr@yahoo.com> Newsgroups: borland.public.cppbuilder.database.ado References: <bu8p44$ea1k7$1@ID-215342.news.uni-berlin.de> Subject: Re: ConnectionString Date: Sun, 18 Jan 2004 14:15:44 -0800 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 68.103.106.146 Message-ID: <400c3999@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1074543001 68.103.106.146 (19 Jan 2004 12:10:01 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mail