amateursRus
Technical User
Hi Folks,
I appreciate you may not consider this the correct forum but with the wealth of knowledge here I was hoping some kind soul would take pity on me...
I've a Delphi program which connects to an Access DB using ADO.
The program works fine, making multiple connections and re-connections, right up to the point where it tries to connect to a table called 'CareerRejectTemp'.
Now, I know this table exists because I've put specific code into the module which retrieves a list of DB tables into a stringlist, reads through this and - if it finds the required table (which I've hard-coded into the program as I know it's there) - connects and retrieve the contents.
Part of the code is enclosed...
sl:= TStringList.Create;
with ADOConnection1 do
GetTableNames(sl, False);
for i:= 0 to sl.Count-1 do
if (sl= 'CareerRejectTemp') then begin
UserSQL:= 'SELECT * FROM ' + sl;
AdoQ:= ADOQuery1;
Result:= AdoQueryGeneral(AdoQ, UserSQL);
end;
AdoQueryGeneral is just that - a generalised Query that runs all the other queries the program throws at it with no problems.
The error I'm getting is -
"Item cannot be found in the collection corresponding to the requested name or ordinal".
But if it wasn't there the "If (sl= 'CareerRejectTemp') then " wouldn't fire.....
Can anyone help?
I appreciate you may not consider this the correct forum but with the wealth of knowledge here I was hoping some kind soul would take pity on me...
I've a Delphi program which connects to an Access DB using ADO.
The program works fine, making multiple connections and re-connections, right up to the point where it tries to connect to a table called 'CareerRejectTemp'.
Now, I know this table exists because I've put specific code into the module which retrieves a list of DB tables into a stringlist, reads through this and - if it finds the required table (which I've hard-coded into the program as I know it's there) - connects and retrieve the contents.
Part of the code is enclosed...
sl:= TStringList.Create;
with ADOConnection1 do
GetTableNames(sl, False);
for i:= 0 to sl.Count-1 do
if (sl= 'CareerRejectTemp') then begin
UserSQL:= 'SELECT * FROM ' + sl;
AdoQ:= ADOQuery1;
Result:= AdoQueryGeneral(AdoQ, UserSQL);
end;
AdoQueryGeneral is just that - a generalised Query that runs all the other queries the program throws at it with no problems.
The error I'm getting is -
"Item cannot be found in the collection corresponding to the requested name or ordinal".
But if it wasn't there the "If (sl= 'CareerRejectTemp') then " wouldn't fire.....
Can anyone help?