通过InstallShield 还原数据库的DLL(DELPHI)
来源:互联网 发布:春雨面膜淘宝授权 编辑:程序博客网 时间:2024/06/06 16:36
library DBInstall;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
ComServ,
SysUtils,
Classes,
Forms,
uFrmMain in 'uFrmMain.pas' {FrmMain};
{ Open the MainForm, the entertance of Library}
function OpenForm():integer; stdcall;
var
FrmMain: TFrmMain;
begin
FrmMain:=TFrmMain.Create(nil);
FrmMain.ShowModal();
result:=0;
FrmMain.Free;
end;
exports
DllGetClassObject,
DllCanUnloadNow,
DllRegisterServer,
DllUnregisterServer,
OpenForm;
{$R *.res}
begin
end.
unit uFrmMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB;
type
TFrmMain = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
txtUserName: TEdit;
txtPassword: TEdit;
btnOK: TButton;
dbConn: TADOConnection;
ADOQuery1: TADOQuery;
procedure FormShow(Sender: TObject);
procedure btnOKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
implementation
{$R *.dfm}
procedure TFrmMain.FormShow(Sender: TObject);
begin
txtUserName.Text:='sa';
txtPassword.Text:='';
end;
procedure TFrmMain.btnOKClick(Sender: TObject);
var
isErrRetry: bool;
begin
isErrRetry:=false;
dbConn.ConnectionString:='Provider=SQLOLEDB.1;'
+'Password='+Trim(txtPassword.Text)+';Persist Security Info=True;User ID='+Trim(txtUserName.Text)+';Data Source=localhost';
try
dbConn.Open();
ADOQuery1.SQL.Text:='RESTORE DATABASE MyNwind FROM MyNwind_1';
ADOQuery1.ExecSQL;
except on E:Exception do
begin
if MessageDlg('存在错误:'+E.Message+'是否忽略',mtError,[mbRetry,mbIgnore],0)=mrRetry then
isErrRetry:=true
else
isErrRetry:=false;
end;
end;
dbConn.Close();
if not isErrRetry then ModalResult:=mrOK;
end;
end.
- 通过InstallShield 还原数据库的DLL(DELPHI)
- 用InstallShield Developer 8 创建WEB站点并且引用dll还原数据库
- DELPHI中使用DLL的方法以及INSTALLSHIELD中使用DLL方法
- Delphi备份/还原数据库
- InstallShield Express制作Delphi数据库安装程序
- 通过语句还原数据库
- 数据库备份与还原(Delphi)
- delphi中实现Sqlserver2000数据库的备份与还原!
- 通过批处理备份/还原数据库
- 如果通过.mdf还原数据库
- MariaDB通过命令行还原数据库
- InstallShield如何调用c++的dll
- InstallShield如何调用c++的dll
- php 通过网页的方式备份和还原mysql数据库
- php 通过网页的方式备份和还原mysql数据库
- php 通过网页的方式备份和还原mysql数据库
- 通过Java来备份与还原Mysql数据库的代码
- 通过Java备份Oracle数据库和还原Oracle的方法
- ORACLE问题,每天10问(六)
- 如何利用Apache+Tomcat配置JSP开发环境?
- 使用Tangram构造你自己的软件开发平台(二)
- JS写的cookie类
- 用InstallShield Developer 8 创建WEB站点并且引用dll还原数据库
- 通过InstallShield 还原数据库的DLL(DELPHI)
- 我迷惘了,彷徨了!
- 基于组件的C#农历算法
- 用VB写的一个组件,实现添加系统用户,并添加到指定组
- C#中委托,事件理解入门
- ASP.NET WAP开发的一些情况
- 英语作文不可不背的35个短语 --其实只有16个
- AspectJ学习笔记(二)
- 权限系统概要(收集,整理)