Спасибо всем за подсказки! Когда я нажимаю F7, то сначала отладчик проверяет, а потом останавливается и появляется ошибка.
program Project_katalog;
uses
Forms,
Unit1_vvod in 'Unit1_vvod.pas' {Form1},
dm_unit in 'dm_unit.pas' {dm: TDataModule},
view_unit in 'view_unit.pas' {add_form},
zastavka_FLog in 'zastavka_FLog.pas' {Form2},
UPSW in 'UPSW.pas' {FPSW},
pi in 'pi.pas' {Form3},
Unit4 in 'Unit4.pas' {Form4},
RP in 'RP.pas' {Form5};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(Tdm, dm); //
здесь курсор останавливается и ошибка появляется Application.CreateForm(Tadd_form, add_form);
Application.CreateForm(TForm2, Form2);
Application.CreateForm(TFPSW, FPSW);
Application.CreateForm(TForm3, Form3);
Application.CreateForm(TForm4, Form4);
Application.CreateForm(TForm5, Form5);
Application.Run;
end.
А вот все, что у меня есть в датамодуле (код). Только не судите строго. Я только учусь.
unit dm_unit;
interface
uses
SysUtils, Classes, ImgList, Controls, DB, DBTables, Menus, ExtDlgs,
Dialogs;
type
Tdm = class(TDataModule)
Query_razdel_rubr: TQuery;
DataSource2_razdel_rubr: TDataSource;
modif_razdel_rubr: TQuery;
modif_pi: TQuery;
DataSource3: TDataSource;
Query_pi: TQuery;
Query_end_registr: TQuery;
DataSource_end_registr: TDataSource;
Query_sv_instruct: TQuery;
DataSource_sv_instruct: TDataSource;
Query_graf_prilo: TQuery;
DataSource_graf_prilo: TDataSource;
Query_folder: TQuery;
DataSource_folder: TDataSource;
Query_book: TQuery;
DataSource_book: TDataSource;
Query1: TQuery;
DataSource1: TDataSource;
ImageList1: TImageList;
modif: TQuery;
modif2: TQuery;
modif_end_registr_dobav: TQuery;
modif_end_registr: TQuery;
modif_sv_instruct_dobav: TQuery;
modif_sv_instruct: TQuery;
modif_graf_prilo: TQuery;
modif_graf_prilo_dobav: TQuery;
modif_folder_dobav: TQuery;
modif_folder: TQuery;
modif_book_dobav: TQuery;
modif_book: TQuery;
Query_razdel_podrubr: TQuery;
modif_razdel_podrubr: TQuery;
DataSource_razdel_podrubr: TDataSource;
Query_path: TQuery;
modif_path: TQuery;
DataSource2: TDataSource;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
OpenPictureDialog1: TOpenPictureDialog;
SavePictureDialog1: TSavePictureDialog;
Query_perv_folder: TQuery;
Query_perv: TQuery;
modif_perv_folder_dobav: TQuery;
modif_perv_dobav: TQuery;
DataSource_perv_folder: TDataSource;
DataSource_perv: TDataSource;
modif_perv_folder: TQuery;
modif_perv: TQuery;
Query1id: TIntegerField;
Query1InventoryID: TStringField;
Query1Autors: TMemoField;
Query1ReportName: TMemoField;
Query1ReportYear: TStringField;
Query1OrgName: TMemoField;
Query1OrgAdress: TMemoField;
Query1Abstract: TMemoField;
Query1KeyWords: TMemoField;
Query1ColBooks: TIntegerField;
Query1ColFolders: TIntegerField;
Query1ColPervInf: TIntegerField;
Query1dostup_k_referat: TStringField;
Query_bookid: TIntegerField;
Query_bookInventoryID: TStringField;
Query_bookNumberBook: TStringField;
Query_bookDostup: TStringField;
Query_bookTypeBook: TStringField;
Query_bookKolPage: TIntegerField;
Query_bookKolIllustr: TIntegerField;
Query_bookKolTable: TIntegerField;
Query_bookKolTextPrilozh: TIntegerField;
Query_bookKolLiter: TIntegerField;
Query_folderid: TIntegerField;
Query_folderInventoryID: TStringField;
Query_folderNumberFolder: TStringField;
Query_folderDostup: TStringField;
Query_folderColGrafPrilozh: TIntegerField;
Query_graf_priloid_graf_prilo: TIntegerField;
Query_graf_priloInventoryID: TStringField;
Query_graf_priloNumbGrafPrilo: TStringField;
Query_graf_priloNameGrafPrilo: TMemoField;
Query_graf_priloDostup_k_graf_prilo: TStringField;
Query_graf_priloNumberFolder: TStringField;
Query_sv_instructid: TIntegerField;
Query_sv_instructInventoryID: TStringField;
Query_sv_instructIndexInfMaterial: TStringField;
Query_sv_instructIndexStadii: TStringField;
Query_sv_instructIndexTypePI: TStringField;
Query_sv_instructStepenZavershRabot: TStringField;
Query_end_registrid: TIntegerField;
Query_end_registrInventoryID: TStringField;
Query_end_registrter_upr: TStringField;
Query_end_registrAdmOblWork: TMemoField;
Query_end_registrNomenclatura: TStringField;
Query_end_registrRubriki: TStringField;
Query_end_registrpolisk: TStringField;
Query_end_registrpodrubriki: TStringField;
Query_end_registrDateRegistration: TStringField;
Query_end_registrFIO_Registrator: TStringField;
Query_piid_polisk: TIntegerField;
Query_piplsk_name: TStringField;
Query_razdel_rubrid_rub: TIntegerField;
Query_razdel_rubrname_rubriki: TStringField;
Query_razdel_podrubrid_podrubriki: TIntegerField;
Query_razdel_podrubrNamePodrubriki: TStringField;
Query_razdel_podrubrid_rub: TIntegerField;
Query_pathid: TIntegerField;
Query_pathpath: TBlobField;
Query_pathInventoryID: TStringField;
Query_perv_folderid: TIntegerField;
Query_perv_folderInventoryID: TStringField;
Query_perv_folderNumberPerv: TStringField;
Query_perv_folderDostup: TStringField;
Query_perv_folderColPervInf: TIntegerField;
Query_pervid: TIntegerField;
Query_pervInventoryID: TStringField;
Query_pervNumbPervData: TStringField;
Query_pervNamePervData: TMemoField;
Query_pervDostupPervData: TStringField;
Query_pervNumberPerv: TStringField;
procedure N2Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure DataModuleCreate(Sender: TObject);
private
{ Private declarations }
public
procedure ShowError(AExc: EDBEngineError);
procedure delet(r,wher:string;cod:Word);
procedure ebd_error(query_name:TQuery); { Public declarations }
end;
var
dm: Tdm;
implementation
uses Unit1_vvod, view_unit, pi, Unit4, RP;
{$R *.dfm}
{ Tdm }
procedure Tdm.delet(r, wher: string; cod: Word);
var q:TQuery;
begin
q:=TQuery.Create(Self);
q.SQL.Add('delete from '+r+'');
q.SQL.Add('where '+wher+' = '+ IntToStr(cod)+'');
q.DatabaseName:='katalogi';
q.Prepare;
q.ExecSQL;
q.Free;
end;
procedure Tdm.N2Click(Sender: TObject);
begin
with modif_path do begin
Close;
SQL.Clear;
SQL.Add('delete from map_path where InventoryID ='+dm.Query1InventoryID.AsString+'');
Prepare;
ExecSQL;
end;
end;
procedure Tdm.N1Click(Sender: TObject);
var bs:TBlobStream;
begin
with modif_path do
if OpenPictureDialog1.Execute then begin
Form1.image_mapp.Picture.LoadFromFile(OpenPictureDialog1.FileName);
Close;
SQL.Clear;
SQL.Add('insert into map_path (path,InventoryID) values (:0, :1)');
ParamByName('0').LoadFromFile(OpenPictureDialog1.FileName,ftGraphic);
ParamByName('1').AsString := dm.Query1InventoryID.AsString;
Prepare;
ExecSQL;
Query1.Close;
Query1.Open;
end;
end;
procedure Tdm.ebd_error(query_name: TQuery);
var sqll:string;
begin
try
query_name.Close;
query_name.SQL.Clear;
query_name.SQL.Add(sqll);
query_name.Open;
except
on EDBEngineError do query_name.ExecSQL;
end;
end;procedure Tdm.DataModuleCreate(Sender: TObject);
begin
ebd_error(Query1);
ebd_error(Query_book);
ebd_error(Query_folder);
ebd_error(Query_graf_prilo);
ebd_error(Query_sv_instruct);
ebd_error(Query_end_registr);
ebd_error(Query_pi);
ebd_error(Query_razdel_rubr);
ebd_error(Query_razdel_podrubr);
ebd_error(Query_path);
ebd_error(Query_perv_folder);
ebd_error(Query_perv);
end;end.
Вот то, что красным выделено - это жалкие попытки что-то предпринять по поводу ошибки. А вообще отладчик даже не заходит в код датамодуля, он останавливается на
Application.CreateForm(Tdm, dm);