Article View: borland.public.cppbuilder.database.ado
Article #1927Re: Index search method to use
From: Viatcheslav V. Vassiliev
Date: Wed, 21 Jan 2004 06:48
Date: Wed, 21 Jan 2004 06:48
64 lines
3560 bytes
3560 bytes
With indeces you should use Seek() method. This requires CursorLocation =
clUseServer and TableDirect = True.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Alain M. Dube" <adube@cadencesoftware.com> �������/�������� � ��������
���������: news:400e1da8$1@newsgroups.borland.com...
> I've encountered a problem with ADO and Access:
>
> My access database has five tables, each table as multiple indices.
>
> I'm using a TADOConnection and a TADOTable to access the MS Access DB;
code
> below used to setup the objects:
>
> #define CONNECT_STRING_FMT "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=%s;User Id=admin;Password="
>
> // Create a DB Connection COM Object Instance
> mpConnection = new TADOConnection(NULL);
> mpConnection->ConnectOptions = coConnectUnspecified;
> mpConnection->CursorLocation = clUseClient;
> mpConnection->IsolationLevel = ilCursorStability;
> mpConnection->LoginPrompt = false;
> mpConnection->Mode = cmShareDenyNone;
> strConnectionString = Format(CONNECT_STRING_FMT,
> OPENARRAY(TVarRec, (strMediaLibraryDBPath)));
> mpConnection->ConnectionString = strConnectionString;
> mpConnection->Connected = true;
>
> // Create a Table Object Instance for the Container Table
> mpContainerTable = new TADOTable(NULL);
> mpContainerTable->Active = false;
> mpContainerTable->Connection = mpConnection;
> mpContainerTable->CursorType = ctKeyset;
> mpContainerTable->TableName = TABLE_NAME_CONTAINER;
> mpContainerTable->IndexName = INDEX_NAME_PRIMARY;
> mpContainerTable->Active = true;
>
> { ... repeat for each addition table... }
>
> I intend on doing all of the normal database management stuff: a) add,
> modify and delete records, b) search tables using various indices, c)
> transaction bracketing, etc. What method is recommended for doing
> index-based search using a relational operator?
>
> example: get record whose parentID >= 10
>
> In DAO, the recordset.seek() allows a relational operator on one or more
key
> values against the current index. Is there an equivalent?
>
> Thanks in advance for your help.
>
> Regards;
>
> Al Dube
>
>
Technical Details
Message-ID:
<400e20a7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<400e1da8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,cb3d0ba8006d975c X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-01-20 23:09:18 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <400e1da8$1@newsgroups.borland.com> Subject: Re: Index search method to use Date: Wed, 21 Jan 2004 09:48:08 +0300 Lines: 66 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: 213.234.218.42 Message-ID: <400e20a7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1074667687 213.234.218.42 (20 Jan 2004 22:48:07 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail