⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common_unit.pas

📁 学校班级教学管理系统 DELPHI7下的
💻 PAS
字号:
unit Common_Unit;

interface

uses
  SysUtils, Classes, DB, ADODB, Windows, Dialogs, Forms;

type
  TWriteIni = procedure(FileName,Section,Indet,Values: string); stdcall;//写Ini文件
  TReadIni = function(FileName,Section,Indet: string):string; stdcall;  //读Ini文件


  function SQLDataSet(sqlText: string; ADOConn: TADOConnection): TDataSet; stdcall; external 'SQLOperator.dll'; //静态调用DLL
  procedure SQLExecute(sqlText: string; ADOConn: TADOConnection); stdcall; external 'SQLOperator.dll'; // 执行SQL的函数
  function SQLSearch(sqlText: string; ADOConn: TADOConnection): Boolean; stdcall; external 'SQLOperator.dll'; //静态调用DLL

  function DBConFileName(FileName: string): string;
  function FileName: string;

var
  DLLHandle: THandle;
  WriteIni: TWriteIni;
  ReadIni: TReadIni;
  LoginUser: string;   //登录时记录的登录编号,全局变量
  Flag: Integer;    //入学时间和毕业时间的标志 ,全局变量
implementation

function DBConFileName(FileName: string): string;
begin
  try                                               //动态加载DLL,DLL中包含了读取INI文件的函数
    DLLHandle := LoadLibrary('CommInfo.dll');
    @ReadIni :=GetProcAddress(DLLHandle,'ReadIni');
    if @ReadIni <> nil then
      Result := ReadIni(FileName,'BDConn','DBConFileName');
  finally
    FreeLibrary(DLLHandle);  //释放DLL
  end;
end;

function FileName: string;                   //搜索执行文件下的INI文件读取数据库的连接路径
begin
  Result := ExtractFilePath(Application.ExeName) + 'ConfigDB.ini';
end;

end.



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -