🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

DBGrid sorting

#2667
From: James Williams
Date: Tue, 13 May 2003 00:19
31 lines
1985 bytes
Hi,
    I am having trouble try to sort my DBGrid when I click on the column
title.  I am using access for my database and I have been using the code
below.

TADOTable *Tb ;

    if( dynamic_cast<TADOTable*>(DBGrid1->DataSource->DataSet) != NULL) {
        Tb =dynamic_cast<TADOTable*>(DBGrid1->DataSource->DataSet) ;
        try{
            Tb->IndexFieldNames=Column->FieldName;     // <- THIS IS WHERE
PROGRAM GIVES ERROR
        }
        catch(...){
            Tb->IndexFieldNames =  "" ;
        }

    }
I have used this code before and it had worked perfectly.  Now on this new
program it is giving the following error:

Arguments afe of the wrong type, are out of acceptable range, or are in
conflict with one another

I have gone through all of the help sections about the index field name
property and it said that if the cursor location is set incorrectlly that
would cause a problem and I have checked it but without success.  Could
someone please provide some assistance?

Thanks,
James
Technical Details
Message-ID: <3ec039fb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!c03.atl99!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,33aafe152c4cd1ef,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-05-12 17:34:46 PST
From: "James Williams" <bobknows@netzero.net>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: DBGrid sorting
Date: Mon, 12 May 2003 20:19:09 -0400
Lines: 33
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: 67.34.139.202
Message-ID: <3ec039fb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1052785147 67.34.139.202 (12 May 2003 17:19:07 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!c03.atl99!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail