2024-07-07 09:35:27 +08:00
|
|
|
|
unit U_DataLink;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
SysUtils, Classes, DB, ADODB, ImgList, Controls, cxStyles, cxLookAndFeels,
|
|
|
|
|
Windows, Messages, forms, OleCtnrs, DateUtils, ExtCtrls, SyncObjs, cxClasses,
|
2024-07-07 19:26:56 +08:00
|
|
|
|
dxSkinsCore, dxSkinsDefaultPainters, System.ImageList, dxSkinWXI,
|
|
|
|
|
U_BaseDataLink, dxCore, cxLocalization, cxImageList, cxGraphics, cxEdit,
|
|
|
|
|
cxContainer, dxSkinsForm, dxSkinBasic, dxSkinBlack, dxSkinBlue,
|
|
|
|
|
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkroom, dxSkinDarkSide,
|
|
|
|
|
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|
|
|
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|
|
|
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|
|
|
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|
|
|
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|
|
|
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|
|
|
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
|
|
|
|
dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
|
|
|
|
|
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
|
|
|
|
|
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
|
|
|
|
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
|
|
|
|
|
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
|
|
|
|
|
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
|
|
|
|
|
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint,
|
|
|
|
|
dxSkinXmas2008Blue, dxLayoutLookAndFeels;
|
2024-07-07 09:35:27 +08:00
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
TMyThread = class(TThread)
|
|
|
|
|
protected
|
|
|
|
|
procedure Execute; override;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
DConString: string; {ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>}
|
|
|
|
|
server, dtbase, user, pswd: string; {<7B><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD>}
|
|
|
|
|
DCurHandle: hwnd; //<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
DName: string; //#<23>û<EFBFBD><C3BB><EFBFBD>#//
|
|
|
|
|
DCode: string; //#<23>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>#//
|
|
|
|
|
Ddatabase: string; //#<23><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD>#//
|
|
|
|
|
DTitCaption: string; //#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#//
|
|
|
|
|
PicSvr: string;
|
|
|
|
|
fDllFileName: string;
|
|
|
|
|
DParameters1, DParameters2, DParameters3, DParameters4, DParameters5: string; // <20>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
DParameters6, DParameters7, DParameters8, DParameters9, DParameters10: string; //<2F>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
OldDllApp: Tapplication; //<2F><><EFBFBD><EFBFBD>ԭ<EFBFBD>о<EFBFBD><D0BE><EFBFBD>
|
|
|
|
|
NewDllApp: Tapplication; //<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
|
|
|
|
|
MainApplication: Tapplication;
|
|
|
|
|
DFormCode: integer; //<2F><>ǰ<EFBFBD><C7B0><EFBFBD>ں<EFBFBD>
|
|
|
|
|
IsDelphiLanguage: integer;
|
|
|
|
|
DServerDate: TdateTime; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
DCompany: string; //<2F><>˾
|
|
|
|
|
IpCall: Integer;
|
|
|
|
|
IpWLDZStr: string;
|
|
|
|
|
UserDataFlag: string;
|
|
|
|
|
|
|
|
|
|
type
|
2024-07-07 19:26:56 +08:00
|
|
|
|
TDataLink_YarnStk = class(TBaseDataLink)
|
2024-07-07 09:35:27 +08:00
|
|
|
|
AdoDataLink: TADOQuery;
|
|
|
|
|
ADOLink: TADOConnection;
|
|
|
|
|
ThreeImgList: TImageList;
|
|
|
|
|
Timer_link: TTimer;
|
|
|
|
|
ImageList_new32: TImageList;
|
|
|
|
|
procedure DataModuleDestroy(Sender: TObject);
|
|
|
|
|
procedure Timer_linkTimer(Sender: TObject);
|
|
|
|
|
procedure DataModuleCreate(Sender: TObject);
|
|
|
|
|
private
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
TMakebar = procedure(ucData: pchar; nDataLen: integer; nErrLevel: integer; nMask: integer; nBarEdition: integer; szBmpFileName: pchar; nScale: integer); stdcall;
|
|
|
|
|
|
|
|
|
|
TMixtext = procedure(szSrcBmpFileName: PChar; szDstBmpFileName: PChar; sztext: PChar; fontsize, txtheight, hmargin, vmargin, txtcntoneline: integer); stdcall;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
DataLink_YarnStk: TDataLink_YarnStk;
|
|
|
|
|
CriticalSection: TCriticalSection; {<7B><><EFBFBD><EFBFBD><EFBFBD>ٽ<EFBFBD>}
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
procedure TMyThread.Execute;
|
|
|
|
|
begin
|
|
|
|
|
FreeOnTerminate := True;
|
|
|
|
|
CriticalSection.Enter;
|
|
|
|
|
try
|
|
|
|
|
with DataLink_YarnStk.AdoDataLink do
|
|
|
|
|
begin
|
|
|
|
|
close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('select getdate()');
|
|
|
|
|
open;
|
|
|
|
|
end;
|
|
|
|
|
except
|
|
|
|
|
try
|
|
|
|
|
with DataLink_YarnStk.ADOLink do
|
|
|
|
|
begin
|
|
|
|
|
Connected := false;
|
|
|
|
|
ConnectionString := DConString;
|
|
|
|
|
LoginPrompt := false;
|
|
|
|
|
Connected := true;
|
|
|
|
|
end;
|
|
|
|
|
except
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
CriticalSection.Leave;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TDataLink_YarnStk.DataModuleDestroy(Sender: TObject);
|
|
|
|
|
begin
|
2024-07-07 19:26:56 +08:00
|
|
|
|
inherited;
|
2024-07-07 09:35:27 +08:00
|
|
|
|
CriticalSection.Free;
|
|
|
|
|
DataLink_YarnStk := nil;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TDataLink_YarnStk.Timer_linkTimer(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
TMyThread.Create(False);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TDataLink_YarnStk.DataModuleCreate(Sender: TObject);
|
|
|
|
|
begin
|
2024-07-07 19:26:56 +08:00
|
|
|
|
inherited;
|
2024-07-07 09:35:27 +08:00
|
|
|
|
CriticalSection := TCriticalSection.Create;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|