Board index » cppbuilder » "Index does not exists" error

"Index does not exists" error


2005-08-19 06:08:11 PM
cppbuilder103
Hi all,
I am using the following provider : MS OLE DB Provider for ODBC Drivers, to
connect to InterBase.
I read in a previous posting that indexes are not supported in the provider
for SQLServer.
This prompted me to find out if the above provider I used supports Indexes
too. When I set the table to active in the code below, ADOTable_FPUser (a
TADOTable) returns an exception - "Index does not exists". (See arrow
pointer in the code below).
What I wanted to do was to search a table (using the Seek function) for a
specific user ID (1234 in this example). I have double-checked that the
table name and index name are correct (hopefully).
Code Snippet:
{
ADOConnectionExternal->Connected = true;
ADOTable_FPUser->Connection = ADOConnectionExternal;
ADOTable_FPUser->TableDirect = true;
ADOTable_FPUser->TableName = "FPUSER";
ADOTable_FPUser->IndexName = "FPUSER_USERIDSTR";
ADOTable_FPUser->CursorLocation = clUseServer;
ADOTable_FPUser->Active = true; // <--- Error happens here.
ADODataSet_FPUser->Seek("1234", soAfterEQ);
}
Does anyone have any idea? Or have I left out anything? Thank you.
Regards,
Tze Wan
 
 

Re:"Index does not exists" error

I do not known OLEDB provider other than MS Jet that supports Seek. AFAIK,
Interbase/Firebird support only forward-only datasets in their API, so using
Seek needs cache of rows implemented somewhere. Use client-side cursor and
Locate if you have not much data, or execute query with WHERE ID = 1234.
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Foo Tze Wan" < XXXX@XXXXX.COM >сообщи?сообщила ?новостях следующе?
Quote
Hi all,

I am using the following provider : MS OLE DB Provider for ODBC Drivers,
to
connect to InterBase.

I read in a previous posting that indexes are not supported in the
provider
for SQLServer.

This prompted me to find out if the above provider I used supports Indexes
too. When I set the table to active in the code below, ADOTable_FPUser (a
TADOTable) returns an exception - "Index does not exists". (See arrow
pointer in the code below).

What I wanted to do was to search a table (using the Seek function) for a
specific user ID (1234 in this example). I have double-checked that the
table name and index name are correct (hopefully).

Code Snippet:
{
ADOConnectionExternal->Connected = true;

ADOTable_FPUser->Connection = ADOConnectionExternal;
ADOTable_FPUser->TableDirect = true;
ADOTable_FPUser->TableName = "FPUSER";
ADOTable_FPUser->IndexName = "FPUSER_USERIDSTR";
ADOTable_FPUser->CursorLocation = clUseServer;
ADOTable_FPUser->Active = true; // <--- Error happens here.

ADODataSet_FPUser->Seek("1234", soAfterEQ);
}

Does anyone have any idea? Or have I left out anything? Thank you.

Regards,
Tze Wan


 

Re:"Index does not exists" error

Thanks Viatcheslav, for your insight. Will also read up on "forward-only"
datasets to understand more.
I have posted yet another question on blob fields...
Regards,
Tze Wan
"Viatcheslav V. Vassiliev" < XXXX@XXXXX.COM >wrote in message
I do not known OLEDB provider other than MS Jet that supports Seek. AFAIK,
Interbase/Firebird support only forward-only datasets in their API, so using
Seek needs cache of rows implemented somewhere. Use client-side cursor and
Locate if you have not much data, or execute query with WHERE ID = 1234.
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
 

{smallsort}