Board index » delphi » dbiAddIndex

dbiAddIndex

can anyone tell me why the following code gives me an error at runtime

error : "invalid handle to function call"
also i now get
    "an error ocurred while attempting to initialise the borland database
engine"

problem code :-

Check(DbiAddIndex(Datamodule1.tblSource.dbhandle,
Datamodule1.tblSource.handle,
PChar(Datamodule1.tblSource.TableName),szDBASE, NewIndex, nil));

I basically want to create an index at runtime on a dbase table, the values
for dbhandle & handle seem to be nil.  Dont quite understand why they should
be nil ????

 

Re:dbiAddIndex


can anyone tell me why the following code gives me an error at runtime

error : "invalid handle to function call"
also i now get
    "an error ocurred while attempting to initialise the borland database
engine"

problem code :-

Check(DbiAddIndex(Datamodule1.tblSource.dbhandle,
Datamodule1.tblSource.handle,
PChar(Datamodule1.tblSource.TableName),szDBASE, NewIndex, nil));

I basically want to create an index at runtime on a dbase table, the values
for dbhandle & handle seem to be nil.  Dont quite understand why they should
be nil ????

mark.whee...@independentenergy.co.uk

Re:dbiAddIndex


I always use AddIndex
(Table1.AddIndex('NewIndex', 'CustNo;CustName', [ixUnique,
ixCaseInsensitive]); (out of Delphi help...)
 of the TTable but ...
 is the table opened? Table should be opened in exclusive mode if
memory serves me correctly...

Hope this helps?...

On Mon, 15 Nov 1999 16:43:18 -0000, "mark"

Quote
<mark.whee...@ftech.independentenergy.co.uk> wrote:
>can anyone tell me why the following code gives me an error at runtime

>error : "invalid handle to function call"
>also i now get
>    "an error ocurred while attempting to initialise the borland database
>engine"

>problem code :-

>Check(DbiAddIndex(Datamodule1.tblSource.dbhandle,
>Datamodule1.tblSource.handle,
>PChar(Datamodule1.tblSource.TableName),szDBASE, NewIndex, nil));

>I basically want to create an index at runtime on a dbase table, the values
>for dbhandle & handle seem to be nil.  Dont quite understand why they should
>be nil ????

>mark.whee...@independentenergy.co.uk

Re:dbiAddIndex


On Mon, 15 Nov 1999 16:41:38 -0000, "mark"

Quote
<mark.whee...@ftech.independentenergy.co.uk> wrote:
>can anyone tell me why the following code gives me an error at runtime

>error : "invalid handle to function call"
>also i now get
>    "an error ocurred while attempting to initialise the borland database
>engine"

>problem code :-

>Check(DbiAddIndex(Datamodule1.tblSource.dbhandle,
>Datamodule1.tblSource.handle,
>PChar(Datamodule1.tblSource.TableName),szDBASE, NewIndex, nil));

>I basically want to create an index at runtime on a dbase table, the values
>for dbhandle & handle seem to be nil.  Dont quite understand why they should
>be nil ????

Is the Active property for the TTable set to True? If it is False, the
table is not active and you do not have a handle to that table.

==========================================================================
Steve Koterski                  "Computers are useless. They can only give
Technical Publications          you answers."
Borland                                       -- Pablo Picasso (1881-1973)
http://www.borland.com/techpubs/delphi

Other Threads