🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3159

Re: Create connection to ADO in run time

#3159
From: Vassiliev V.V.
Date: Sun, 24 Nov 2002 10:49
46 lines
2429 bytes
If I understood you right, you want to write:

ADOConnection1->ConnectionString = ...;
ADOConnection1->Connected = true;

Create the variable:

WideString ConnStr;
ConnStr = ...;
//Set breakpoint on next line
ADOConnection1->ConnectionString = ConnStr;
ADOConnection1->Connected = true;

and check that ConnStr is what you want. If you just copy connection string
you should change all '\' to '\\' according C string rules. For example,
valid connection string in C is valid (of course, if C:\Temp\Test.mdb
exists):

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Temp\\Test.mdb;

Note '\\' as path separators.

----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server and MS Jet (MS Access) databases.



"Fabrizio" <zaksubzero@lycos.it> �������/�������� � �������� ���������:
news:3de09e83@newsgroups.borland.com...
> Hi,
> I want to create a connection to Access 2000 in run time.
> I've used TADOConnection for the connection with a local db and
TADODataSet
> to use the db. In project-time i haven't any problems, but if I use the
same
> connection string of TADOConnection in run time, I've have the error
> "Invalid file name". It's very strange becouse i copy the string without
any
> change.
>
> Thanks
>
>
Technical Details
Message-ID: <3de0b98d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!isdnet!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3de09e83@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,a4ebdf3218b0a278
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-11-24 03:42:02 PST
From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3de09e83@newsgroups.borland.com>
Subject: Re: Create connection to ADO in run time
Date: Sun, 24 Nov 2002 13:49:09 +0300
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 212.188.97.37
Message-ID: <3de0b98d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1038137741 212.188.97.37 (24 Nov 2002 03:35:41 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!isdnet!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail