小弟用sql server做数据库,bde连接,安装后将从网络服务器读取数据,请问我的安装程序需要怎样才能保证我安装时少些麻烦,或者我交给用户安装,他怎么去配置数据库,急!
13 个解决方案
#1
我做安装盘用YOUSFULL 构件好用,你可以在试试,如果找不见我可给你发一个
EMAIL:g-m-l@163.net
EMAIL:g-m-l@163.net
#2
不能用控件的,我不知道在安装程序中怎样设置数据库连接,譬如我使用别名为mssql的方式连接sql server数据库,请问在服务器端如果数据库的名字改了怎么办(或者是安装时是用的别的数据库名),我用的是配套安装程序install shield.
#3
使用Install shield制作安装盘,再编制一个客户端配置程序,使用Tsession动态修改BDE,其中与服务器有关的名字可由用户指定。详细情况请mail至:lotto@njjxrj.com
#4
lotto的方法最可行!
算来有两种方案:
1、用InstallShield制作安装盘在服务器端安装,然后在客户端安装一个自己制作的客户端配置程序即可!无非是修改注册表而已!
2、每个客户端都安装!然后用TSession动态修改BDE,OK!
算来有两种方案:
1、用InstallShield制作安装盘在服务器端安装,然后在客户端安装一个自己制作的客户端配置程序即可!无非是修改注册表而已!
2、每个客户端都安装!然后用TSession动态修改BDE,OK!
#5
我回去试一下
#6
用wise8.1
#7
不知大家用delphi做产品时,安装文件是怎么做的,用户购买产品之后只需安装便可以用,这就包括安装程序应该创建数据库,创建表,以及连接数据库的工作都需在安装程序中完成,请问大家是这样做的吗?如果是请告知该怎样去实现!
#8
關注!!關注!!關注!!----用户购买产品之后只需安装便可以用,这就包括安装程序应该创建数据库,创建表,以及连接数据库的工作都需在安装程序中完成,请问大家是这样做的吗?如果是请告知该怎样去实现!
#9
关注!
#10
1.制作安装程序可以使用InstallShield for delphi
2.我的每个系统都是引用这个unit解决连接问题,基本上只需要设置system.ini文件就可以了.不用维护如何连接数据库.并且不用配置BDE. 另外,创建数据库也可以将SQL语句写到txt文件中,使用query.loadfromfile调用就可以了,如果需要加密,那么就自己做一个自定义格式的文件吧.
// ******************************************* //
// Database Connect Utility
//
// Copyright (c) 2000 by Ghsoft
//
// Written by Eric Gong 2000.05
//
// ******************************************* //
unit frm_account;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Buttons, Inifiles, dbTables;
type
TformState = (fsDetail, fsSimple);
TfrmAccount = class(TForm)
Label1: TLabel;
cbxAcct: TComboBox;
Bevel1: TBevel;
CmdDetail: TBitBtn;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
edServer: TEdit;
edUser: TEdit;
edPassword: TEdit;
CmdOK: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure CmdDetailClick(Sender: TObject);
procedure CmdOKClick(Sender: TObject);
procedure cbxAcctChange(Sender: TObject);
private
{ Private declarations }
FDB:^TDatabase;
FFormState:Tformstate;
FInifile:TInifile;
procedure SetFormstate(Value:Tformstate);
procedure GetAccountDetail(AccountName:String);
Function Getformstate:Tformstate;
property FormState :TformState Read GetFormState write SetFormstate;
public
{ Public declarations }
end;
var
frmAccount: TfrmAccount;
Function ChangeAccount(var db:TDatabase):Boolean;
implementation
{$R *.DFM}
//Function : Change Database connectoin
//Params : db :Tdatabase
//Return Value: Boolean
//sample: if ChangeAccount(db_mis) then do {something about database db_mis} ;
Function ChangeAccount(var db:TDatabase):Boolean;
var
sAcctTitle:String;
begin
with TfrmAccount.Create(nil) do
begin
FDB:= @db;
FINIFile:= TINIFile.Create(ExtractFilePath(Application.exename)+'system.ini');
fIniFile.ReadSection('Account',cbxAcct.Items);
sAcctTitle:= fIniFile.readString('Login','Account','Data');
cbxAcct.ItemIndex:= cbxAcct.Items.IndexOf(sAcctTitle);
GetAccountDetail(fInifile.Readstring('Account',sAcctTitle,''));
showmodal;
Result:= modalResult = mrOK;
if Result then fIniFile.WriteString('Login','Account',cbxAcct.text);
fIniFile.Free;
Free;
end;
end;
procedure TfrmAccount.GetAccountDetail(AccountName:String);
begin
edServer.Text:= fInifile.Readstring(AccountName,'Server Name','狝叭竟');
edUser.Text:= fInifile.ReadString(AccountName,'User Name','sa');
edPassword.Text:= fInifile.ReadString(AccountName,'Password','');
end;
procedure TfrmAccount.SetFormstate(Value:Tformstate);
begin
if FFormState <> Value then
begin
FFormState := Value;
case Value of
fsSimple : begin CmdDetail.Caption:= '冈灿 >>'; Height := 120; end;
fsDetail : begin CmdDetail.Caption:= '<< 虏て'; Self.Height := 225; end;
end;
end;
end;
Function TfrmAccount.Getformstate:Tformstate;
begin
Result:= FFormState;
end;
procedure TfrmAccount.FormCreate(Sender: TObject);
begin
FormState:= fsSimple;
end;
procedure TfrmAccount.CmdDetailClick(Sender: TObject);
begin
if formstate = fsDetail then formstate := fsSimple else formstate := fsDetail;
end;
procedure TfrmAccount.CmdOKClick(Sender: TObject);
begin
modalResult:= mrNone;
with FDb^ as TDatabase do
begin
connected:= False;
params.clear;
Params.Add('SERVER NAME='+edServer.Text);
Params.Add('DATABASE NAME='+fInifile.ReadString(fInifile.Readstring('Account',cbxAcct.Items[cbxAcct.ItemIndex],''),'DATABASE NAME','MASTER'));
Params.Add('USER NAME='+edUser.Text);
Params.Add('PASSWORD='+edPassword.Text);
Connected:= True;
end;
modalResult:= mrOK;
end;
procedure TfrmAccount.cbxAcctChange(Sender: TObject);
begin
GetAccountDetail(fInifile.Readstring('Account',cbxAcct.Items[cbxAcct.ItemIndex],''));
end;
end.
2.我的每个系统都是引用这个unit解决连接问题,基本上只需要设置system.ini文件就可以了.不用维护如何连接数据库.并且不用配置BDE. 另外,创建数据库也可以将SQL语句写到txt文件中,使用query.loadfromfile调用就可以了,如果需要加密,那么就自己做一个自定义格式的文件吧.
// ******************************************* //
// Database Connect Utility
//
// Copyright (c) 2000 by Ghsoft
//
// Written by Eric Gong 2000.05
//
// ******************************************* //
unit frm_account;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Buttons, Inifiles, dbTables;
type
TformState = (fsDetail, fsSimple);
TfrmAccount = class(TForm)
Label1: TLabel;
cbxAcct: TComboBox;
Bevel1: TBevel;
CmdDetail: TBitBtn;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
edServer: TEdit;
edUser: TEdit;
edPassword: TEdit;
CmdOK: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure CmdDetailClick(Sender: TObject);
procedure CmdOKClick(Sender: TObject);
procedure cbxAcctChange(Sender: TObject);
private
{ Private declarations }
FDB:^TDatabase;
FFormState:Tformstate;
FInifile:TInifile;
procedure SetFormstate(Value:Tformstate);
procedure GetAccountDetail(AccountName:String);
Function Getformstate:Tformstate;
property FormState :TformState Read GetFormState write SetFormstate;
public
{ Public declarations }
end;
var
frmAccount: TfrmAccount;
Function ChangeAccount(var db:TDatabase):Boolean;
implementation
{$R *.DFM}
//Function : Change Database connectoin
//Params : db :Tdatabase
//Return Value: Boolean
//sample: if ChangeAccount(db_mis) then do {something about database db_mis} ;
Function ChangeAccount(var db:TDatabase):Boolean;
var
sAcctTitle:String;
begin
with TfrmAccount.Create(nil) do
begin
FDB:= @db;
FINIFile:= TINIFile.Create(ExtractFilePath(Application.exename)+'system.ini');
fIniFile.ReadSection('Account',cbxAcct.Items);
sAcctTitle:= fIniFile.readString('Login','Account','Data');
cbxAcct.ItemIndex:= cbxAcct.Items.IndexOf(sAcctTitle);
GetAccountDetail(fInifile.Readstring('Account',sAcctTitle,''));
showmodal;
Result:= modalResult = mrOK;
if Result then fIniFile.WriteString('Login','Account',cbxAcct.text);
fIniFile.Free;
Free;
end;
end;
procedure TfrmAccount.GetAccountDetail(AccountName:String);
begin
edServer.Text:= fInifile.Readstring(AccountName,'Server Name','狝叭竟');
edUser.Text:= fInifile.ReadString(AccountName,'User Name','sa');
edPassword.Text:= fInifile.ReadString(AccountName,'Password','');
end;
procedure TfrmAccount.SetFormstate(Value:Tformstate);
begin
if FFormState <> Value then
begin
FFormState := Value;
case Value of
fsSimple : begin CmdDetail.Caption:= '冈灿 >>'; Height := 120; end;
fsDetail : begin CmdDetail.Caption:= '<< 虏て'; Self.Height := 225; end;
end;
end;
end;
Function TfrmAccount.Getformstate:Tformstate;
begin
Result:= FFormState;
end;
procedure TfrmAccount.FormCreate(Sender: TObject);
begin
FormState:= fsSimple;
end;
procedure TfrmAccount.CmdDetailClick(Sender: TObject);
begin
if formstate = fsDetail then formstate := fsSimple else formstate := fsDetail;
end;
procedure TfrmAccount.CmdOKClick(Sender: TObject);
begin
modalResult:= mrNone;
with FDb^ as TDatabase do
begin
connected:= False;
params.clear;
Params.Add('SERVER NAME='+edServer.Text);
Params.Add('DATABASE NAME='+fInifile.ReadString(fInifile.Readstring('Account',cbxAcct.Items[cbxAcct.ItemIndex],''),'DATABASE NAME','MASTER'));
Params.Add('USER NAME='+edUser.Text);
Params.Add('PASSWORD='+edPassword.Text);
Connected:= True;
end;
modalResult:= mrOK;
end;
procedure TfrmAccount.cbxAcctChange(Sender: TObject);
begin
GetAccountDetail(fInifile.Readstring('Account',cbxAcct.Items[cbxAcct.ItemIndex],''));
end;
end.
#11
如果需要详细交流,请联系我:
ghsoft@yeah.net
http://ghsoft.yeah.net
ghsoft@yeah.net
http://ghsoft.yeah.net
#12
可以用Delphi的Installshield来制作安装程序,在General options选项中第一项BDE,在下一步中选择full BDE installation,在下一步中不要建别名,使其为空,完成后单击确定按扭就可以了,在其它有Sql server的机器上安装此程序后,在控制面板中的BDE Administrator中为其手工配置一个数据库别名,这样就可以运行程序了,以后不须再配置BDE了.
#13
楼上各位兄弟的注意不错,我回去试试,不过在昨天我想了另一个方法,使用bde的API,在DELPHI中应该没有问题,但我的版本是cb5,请各位查看一下是否您的机器中有idapi.h这个文件,如果有的话,谢谢您发过来。作成后与您一起分享。
#1
我做安装盘用YOUSFULL 构件好用,你可以在试试,如果找不见我可给你发一个
EMAIL:g-m-l@163.net
EMAIL:g-m-l@163.net
#2
不能用控件的,我不知道在安装程序中怎样设置数据库连接,譬如我使用别名为mssql的方式连接sql server数据库,请问在服务器端如果数据库的名字改了怎么办(或者是安装时是用的别的数据库名),我用的是配套安装程序install shield.
#3
使用Install shield制作安装盘,再编制一个客户端配置程序,使用Tsession动态修改BDE,其中与服务器有关的名字可由用户指定。详细情况请mail至:lotto@njjxrj.com
#4
lotto的方法最可行!
算来有两种方案:
1、用InstallShield制作安装盘在服务器端安装,然后在客户端安装一个自己制作的客户端配置程序即可!无非是修改注册表而已!
2、每个客户端都安装!然后用TSession动态修改BDE,OK!
算来有两种方案:
1、用InstallShield制作安装盘在服务器端安装,然后在客户端安装一个自己制作的客户端配置程序即可!无非是修改注册表而已!
2、每个客户端都安装!然后用TSession动态修改BDE,OK!
#5
我回去试一下
#6
用wise8.1
#7
不知大家用delphi做产品时,安装文件是怎么做的,用户购买产品之后只需安装便可以用,这就包括安装程序应该创建数据库,创建表,以及连接数据库的工作都需在安装程序中完成,请问大家是这样做的吗?如果是请告知该怎样去实现!
#8
關注!!關注!!關注!!----用户购买产品之后只需安装便可以用,这就包括安装程序应该创建数据库,创建表,以及连接数据库的工作都需在安装程序中完成,请问大家是这样做的吗?如果是请告知该怎样去实现!
#9
关注!
#10
1.制作安装程序可以使用InstallShield for delphi
2.我的每个系统都是引用这个unit解决连接问题,基本上只需要设置system.ini文件就可以了.不用维护如何连接数据库.并且不用配置BDE. 另外,创建数据库也可以将SQL语句写到txt文件中,使用query.loadfromfile调用就可以了,如果需要加密,那么就自己做一个自定义格式的文件吧.
// ******************************************* //
// Database Connect Utility
//
// Copyright (c) 2000 by Ghsoft
//
// Written by Eric Gong 2000.05
//
// ******************************************* //
unit frm_account;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Buttons, Inifiles, dbTables;
type
TformState = (fsDetail, fsSimple);
TfrmAccount = class(TForm)
Label1: TLabel;
cbxAcct: TComboBox;
Bevel1: TBevel;
CmdDetail: TBitBtn;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
edServer: TEdit;
edUser: TEdit;
edPassword: TEdit;
CmdOK: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure CmdDetailClick(Sender: TObject);
procedure CmdOKClick(Sender: TObject);
procedure cbxAcctChange(Sender: TObject);
private
{ Private declarations }
FDB:^TDatabase;
FFormState:Tformstate;
FInifile:TInifile;
procedure SetFormstate(Value:Tformstate);
procedure GetAccountDetail(AccountName:String);
Function Getformstate:Tformstate;
property FormState :TformState Read GetFormState write SetFormstate;
public
{ Public declarations }
end;
var
frmAccount: TfrmAccount;
Function ChangeAccount(var db:TDatabase):Boolean;
implementation
{$R *.DFM}
//Function : Change Database connectoin
//Params : db :Tdatabase
//Return Value: Boolean
//sample: if ChangeAccount(db_mis) then do {something about database db_mis} ;
Function ChangeAccount(var db:TDatabase):Boolean;
var
sAcctTitle:String;
begin
with TfrmAccount.Create(nil) do
begin
FDB:= @db;
FINIFile:= TINIFile.Create(ExtractFilePath(Application.exename)+'system.ini');
fIniFile.ReadSection('Account',cbxAcct.Items);
sAcctTitle:= fIniFile.readString('Login','Account','Data');
cbxAcct.ItemIndex:= cbxAcct.Items.IndexOf(sAcctTitle);
GetAccountDetail(fInifile.Readstring('Account',sAcctTitle,''));
showmodal;
Result:= modalResult = mrOK;
if Result then fIniFile.WriteString('Login','Account',cbxAcct.text);
fIniFile.Free;
Free;
end;
end;
procedure TfrmAccount.GetAccountDetail(AccountName:String);
begin
edServer.Text:= fInifile.Readstring(AccountName,'Server Name','狝叭竟');
edUser.Text:= fInifile.ReadString(AccountName,'User Name','sa');
edPassword.Text:= fInifile.ReadString(AccountName,'Password','');
end;
procedure TfrmAccount.SetFormstate(Value:Tformstate);
begin
if FFormState <> Value then
begin
FFormState := Value;
case Value of
fsSimple : begin CmdDetail.Caption:= '冈灿 >>'; Height := 120; end;
fsDetail : begin CmdDetail.Caption:= '<< 虏て'; Self.Height := 225; end;
end;
end;
end;
Function TfrmAccount.Getformstate:Tformstate;
begin
Result:= FFormState;
end;
procedure TfrmAccount.FormCreate(Sender: TObject);
begin
FormState:= fsSimple;
end;
procedure TfrmAccount.CmdDetailClick(Sender: TObject);
begin
if formstate = fsDetail then formstate := fsSimple else formstate := fsDetail;
end;
procedure TfrmAccount.CmdOKClick(Sender: TObject);
begin
modalResult:= mrNone;
with FDb^ as TDatabase do
begin
connected:= False;
params.clear;
Params.Add('SERVER NAME='+edServer.Text);
Params.Add('DATABASE NAME='+fInifile.ReadString(fInifile.Readstring('Account',cbxAcct.Items[cbxAcct.ItemIndex],''),'DATABASE NAME','MASTER'));
Params.Add('USER NAME='+edUser.Text);
Params.Add('PASSWORD='+edPassword.Text);
Connected:= True;
end;
modalResult:= mrOK;
end;
procedure TfrmAccount.cbxAcctChange(Sender: TObject);
begin
GetAccountDetail(fInifile.Readstring('Account',cbxAcct.Items[cbxAcct.ItemIndex],''));
end;
end.
2.我的每个系统都是引用这个unit解决连接问题,基本上只需要设置system.ini文件就可以了.不用维护如何连接数据库.并且不用配置BDE. 另外,创建数据库也可以将SQL语句写到txt文件中,使用query.loadfromfile调用就可以了,如果需要加密,那么就自己做一个自定义格式的文件吧.
// ******************************************* //
// Database Connect Utility
//
// Copyright (c) 2000 by Ghsoft
//
// Written by Eric Gong 2000.05
//
// ******************************************* //
unit frm_account;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Buttons, Inifiles, dbTables;
type
TformState = (fsDetail, fsSimple);
TfrmAccount = class(TForm)
Label1: TLabel;
cbxAcct: TComboBox;
Bevel1: TBevel;
CmdDetail: TBitBtn;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
edServer: TEdit;
edUser: TEdit;
edPassword: TEdit;
CmdOK: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure CmdDetailClick(Sender: TObject);
procedure CmdOKClick(Sender: TObject);
procedure cbxAcctChange(Sender: TObject);
private
{ Private declarations }
FDB:^TDatabase;
FFormState:Tformstate;
FInifile:TInifile;
procedure SetFormstate(Value:Tformstate);
procedure GetAccountDetail(AccountName:String);
Function Getformstate:Tformstate;
property FormState :TformState Read GetFormState write SetFormstate;
public
{ Public declarations }
end;
var
frmAccount: TfrmAccount;
Function ChangeAccount(var db:TDatabase):Boolean;
implementation
{$R *.DFM}
//Function : Change Database connectoin
//Params : db :Tdatabase
//Return Value: Boolean
//sample: if ChangeAccount(db_mis) then do {something about database db_mis} ;
Function ChangeAccount(var db:TDatabase):Boolean;
var
sAcctTitle:String;
begin
with TfrmAccount.Create(nil) do
begin
FDB:= @db;
FINIFile:= TINIFile.Create(ExtractFilePath(Application.exename)+'system.ini');
fIniFile.ReadSection('Account',cbxAcct.Items);
sAcctTitle:= fIniFile.readString('Login','Account','Data');
cbxAcct.ItemIndex:= cbxAcct.Items.IndexOf(sAcctTitle);
GetAccountDetail(fInifile.Readstring('Account',sAcctTitle,''));
showmodal;
Result:= modalResult = mrOK;
if Result then fIniFile.WriteString('Login','Account',cbxAcct.text);
fIniFile.Free;
Free;
end;
end;
procedure TfrmAccount.GetAccountDetail(AccountName:String);
begin
edServer.Text:= fInifile.Readstring(AccountName,'Server Name','狝叭竟');
edUser.Text:= fInifile.ReadString(AccountName,'User Name','sa');
edPassword.Text:= fInifile.ReadString(AccountName,'Password','');
end;
procedure TfrmAccount.SetFormstate(Value:Tformstate);
begin
if FFormState <> Value then
begin
FFormState := Value;
case Value of
fsSimple : begin CmdDetail.Caption:= '冈灿 >>'; Height := 120; end;
fsDetail : begin CmdDetail.Caption:= '<< 虏て'; Self.Height := 225; end;
end;
end;
end;
Function TfrmAccount.Getformstate:Tformstate;
begin
Result:= FFormState;
end;
procedure TfrmAccount.FormCreate(Sender: TObject);
begin
FormState:= fsSimple;
end;
procedure TfrmAccount.CmdDetailClick(Sender: TObject);
begin
if formstate = fsDetail then formstate := fsSimple else formstate := fsDetail;
end;
procedure TfrmAccount.CmdOKClick(Sender: TObject);
begin
modalResult:= mrNone;
with FDb^ as TDatabase do
begin
connected:= False;
params.clear;
Params.Add('SERVER NAME='+edServer.Text);
Params.Add('DATABASE NAME='+fInifile.ReadString(fInifile.Readstring('Account',cbxAcct.Items[cbxAcct.ItemIndex],''),'DATABASE NAME','MASTER'));
Params.Add('USER NAME='+edUser.Text);
Params.Add('PASSWORD='+edPassword.Text);
Connected:= True;
end;
modalResult:= mrOK;
end;
procedure TfrmAccount.cbxAcctChange(Sender: TObject);
begin
GetAccountDetail(fInifile.Readstring('Account',cbxAcct.Items[cbxAcct.ItemIndex],''));
end;
end.
#11
如果需要详细交流,请联系我:
ghsoft@yeah.net
http://ghsoft.yeah.net
ghsoft@yeah.net
http://ghsoft.yeah.net
#12
可以用Delphi的Installshield来制作安装程序,在General options选项中第一项BDE,在下一步中选择full BDE installation,在下一步中不要建别名,使其为空,完成后单击确定按扭就可以了,在其它有Sql server的机器上安装此程序后,在控制面板中的BDE Administrator中为其手工配置一个数据库别名,这样就可以运行程序了,以后不须再配置BDE了.
#13
楼上各位兄弟的注意不错,我回去试试,不过在昨天我想了另一个方法,使用bde的API,在DELPHI中应该没有问题,但我的版本是cb5,请各位查看一下是否您的机器中有idapi.h这个文件,如果有的话,谢谢您发过来。作成后与您一起分享。