M
MikeR
My apologies if this is an inappropriate post for this group. I tried the DAO group,
but no response.
I've just started getting this error message on a seemingly random basis.
'The Microsoft Jet database engine does not recognize 'CID' as a valid field name or
expression.'
CID is a text field, and it is a valid column name.
The line of code that generates the error is
ListRec.FindFirst('CID = "' + retCID + '"');
The database (Access 2K) is opened like this:
dbE := CreateOleObject('DAO.DBEngine.36');
//open Jet
try
dbDAO := dbE.OpenDatabase(WritePath + FOLDER_NAME + DBName, True, False, ';pwd='
+ '');
except
on E:Exception do
begin
MessageDlg('Error opening database.'#13#10 + E.Message, mtInformation, [mbOK],0);
Result := False;
Application.Terminate;
exit;
end;
end;
ListRec is a DAO recordset, opened with
procedure TfrmLog.OpenCountry;
var
sql: String;
begin
sql := ('Select * from C_List order by CID');
try
ListRec := dbDAO.OpenRecordSet(sql);
ListRec.MoveLast;
except
on E:Exception do
begin
MessageDlg('Error opening Country table.'#13#10 + E.Message, mtInformation,
[mbOK],0);
exit;
end;
end;
end;
The only thing Google brought up wasn't what I need to solve this.
TIA,
Mike
but no response.
I've just started getting this error message on a seemingly random basis.
'The Microsoft Jet database engine does not recognize 'CID' as a valid field name or
expression.'
CID is a text field, and it is a valid column name.
The line of code that generates the error is
ListRec.FindFirst('CID = "' + retCID + '"');
The database (Access 2K) is opened like this:
dbE := CreateOleObject('DAO.DBEngine.36');
//open Jet
try
dbDAO := dbE.OpenDatabase(WritePath + FOLDER_NAME + DBName, True, False, ';pwd='
+ '');
except
on E:Exception do
begin
MessageDlg('Error opening database.'#13#10 + E.Message, mtInformation, [mbOK],0);
Result := False;
Application.Terminate;
exit;
end;
end;
ListRec is a DAO recordset, opened with
procedure TfrmLog.OpenCountry;
var
sql: String;
begin
sql := ('Select * from C_List order by CID');
try
ListRec := dbDAO.OpenRecordSet(sql);
ListRec.MoveLast;
except
on E:Exception do
begin
MessageDlg('Error opening Country table.'#13#10 + E.Message, mtInformation,
[mbOK],0);
exit;
end;
end;
end;
The only thing Google brought up wasn't what I need to solve this.
TIA,
Mike