本文主要介绍使用Installshield进行数据库的安装和卸载,并在InstallShield 11.5 Premier Edition和Installshield 12 Premier Edition环境中测试通过。

1、打开“SQL Scripts view”,如图1

图1.  打开SQL Script View 视图

2、建立一个连接,假定为“MasterConnection”,按照图2和图3设置该连接的属性。

图2 建立连接

图3 设置连接的属性

3、在“MasterConnection”下,新建一个Script,属性的设置如图4,script的内容如下:

1 USEmaster2 3 IFNOTEXISTS(SELECT*4 5 FROMmaster.dbo.sysdatabases6 7 WHEREname='RelayBookkeeping')8 9 CREATEDATABASE'RelayBookkeeping'10 11 GO12

注:RelayBookkeeping是我们需要创建的数据库。

图4 新建一个Script

4、新建连接“RelayBookkeepingConnection”,按照图5设置General属性。Requirements属性的设置参照图3的一样。

图5 设置连接的属性

5、在“RelayBookkeepingConnection”下,新建你自己的数据库脚本。如图6。

图6 添加自己的数据库脚本

6、卸载程序时删除数据库。

操作方法和和新建数据库(步骤1,2,3)类似。建立一个连接,General属性页中,设置数据库名为Master。然后添加一个Script文件,Runtime属性设置为卸载时,内容为:

USEMasterDROPDATABASERelayBookkeepingGO

以下是在帮助里看到的,一篇是安装SQL Server的,一篇是ORACLE的。

------------------------------------------------------------------------------------------------------------------------------------------------

Creating a Sample Project that Will Create a SQL Server Catalog by Running Customized SQL Script

TASK

The following describes how to create a sample project that will create a SQL Server catalog on the target machine by running customized SQL script:

1.Create a new InstallShield project.

2.Go to the Property Manager view.

3.Create a new property named "IS_SQLSERVER_DATABASE2".

4.Go to the SQL Scripts view.

5.Create a new connection and call it "NewConnection1".

6.Click NewConnection1 in the explorer, and select the General tab.

7.Specify "TESTSQLSERVER" as the Target Server Name, and clear the Create Catalog If Absent option.

8.Select the Server Authentication option and specify "sa" as the Login ID and leave the Password field blank.

9.Click the Requirements tab.

10.Select the SQL Server check box and clear the Oracle and MySQL check boxes as the target databases.

11.Right-click NewConnection1 in the explorer, and choose New Script.

12.Rename the new script "NewScript1".

13.Select NewScript1 in the explorer, and click the Script tab.

14.Add the following script:

CREATE DATABASE [TestDB]  ON (NAME = N' TestDB', FILENAME =

N'C:\Program Files\Microsoft SQL Server\MSSQL\data\testdb.mdf' ,

SIZE = 3, FILEGROWTH = 10%) LOG ON (NAME = N' TestDB_log', FILENAME

= N'C:\Program Files\Microsoft SQL Server\MSSQL\data\testdb.ldf' ,

SIZE = 1, FILEGROWTH = 10%)

COLLATE SQL_Latin1_General_CP1_CI_AS

15.Click the Runtime tab, select Run Script During Login, and then clear the other script execution options.

16.Create a new connection in the SQL Scripts view, and call it "NewConnection2".

17.Click NewConnection2 in the explorer, and select the Advanced tab.

18.From the Target Catalog Property Namebox, choose IS_SQLSERVER_DATABASE2.

19.Click the General tab.

20.Specify "TESTSQLSERVER" as the Target Server Name and "TestDB" as the Catalog Name, and then clear the Create Catalog If Absent option.

21.Select the Server Authentication option and specify "sa" as the Login ID and leave the Password field blank.

22.Click the Requirements tab.

23.Select the SQL Server check box and clear the Oracle and MySQL check boxes as the target databases.

24.Right-click NewConnection2 in the explorer, and chooseNew Script.

25.Rename the new script "NewScript2".

26.Select NewScript2 in the explorer, and click the Script tab.

27.Add the following script:

CREATE TABLE TestTable (TestColumn1 CHAR NOT NULL PRIMARY KEY)

28.Click the Runtime tab, select Run Script During Install, and then clear the other script execution options.

------------------------------------------------------------------------------------------------------------------------------------------------

Creating a Sample Project that Will Create an Oracle Catalog by Running Customized SQL Script

TASK

The following describes how to create a sample project that will create an Oracle catalog on the target machine by running customized SQL script:

1.Create a new InstallShield project.

2.Go to the Property Manager view.

3.Create a new property named "IS_SQLSERVER_DATABASE2".

4.Go to the SQL Scripts view.

5.Create a new connection and call it "NewConnection1".

6.Click NewConnection1 in the explorer, and select the General tab.

7.Specify "//sch01jsmith.macrvision.com:1521/orcl" as the Target Server Name, and clear the Create Catalog If Absent option.

8.Select the Server Authentication option and specify "Scott" as the login ID and "Scott" as the password.

9.Click the Requirements tab.

10.Select the Oracle check box and clear the SQL Server and MySQL check boxes as the target databases.

11.Right-click NewConnection1 in the explorer, and choose New Script.

12.Rename the new script "NewScript1".

13.Select NewScript1 in the explorer, and click the Script tab.

14.Add the following script:

CREATE TABLESPACE TEST_TS LOGGING DATAFILE ' /muddle/oracle/sts/ test01.dbf ' SIZE 64K AUTOEXTEND ON NEXT 2M MAXSIZE UNLIMITED

Go

CREATE USER TEST_USER IDENTIFIED BY MYPSWD DEFAULT TABLESPACE TEST_TS QUOTA UNLIMITED on TEST_TS

Go

GRANT CONNECT TO TEST_USER

Go

GRANT DBA TO TEST_USER

Go

ALTER USER TEST_USER DEFAULT ROLE ALL

Go

15.Click the Runtime tab, select Run Script During Login, and then clear the other script execution options.

16.Create a new connection in the SQL Scripts view, and call it "NewConnection2".

17.Click NewConnection2 in the explorer, and select the Advanced tab.

18.From the Target Catalog Property Name box, choose IS_SQLSERVER_DATABASE2.

19.Click the General tab.

20.Specify "//sch01jsmith.macrvision.com:1521/orcl" as the Target Server Name and "TEST_USER" as the Catalog Name, and then clear the Create Catalog If Absent option.

21.Select the Server Authenticationoption and specify "TEST_USER" as the Login ID and "MYPSWD" as the password.

22.Click the Requirements tab.

23.Select the Oracle check box and clear the SQL Server and MySQL check boxes as the target databases.

24.Right-click NewConnection2 in the explorer, and choose New Script.

25.Rename the new script "NewScript2".

26.Select NewScript2 in the explorer, and click the Script tab.

27.Add the following script:

CREATE TABLE TestTable (TestColumn1 CHAR NOT NULL PRIMARY KEY)

28.Click the Runtime tab, select Run Script During Install, and then clear the other script execution options.

installshield 安装mysql数据库_使用 InstallShield 安装和卸载SQL Server 数据库相关推荐

  1. 安装SQL Server2008 r2 提示SQL Server 2005 Express 工具失败和完全卸载SQL Server数据库操作流程

    第一种简单情况可以测试: 32位修改注册表路径:HKLM\Software\Microsoft\Microsoft SQL Server\90\Tools\ShellSEM,把ShellSEM重命名即 ...

  2. sql azure 语法_使用Azure Data Studio开发SQL Server数据库

    sql azure 语法 In the previous article, Starting your journey with Azure Data Studio, we put the first ...

  3. c++访问数据库代码示例 occi_使用Python操作SQL Server数据库

    先说一下SQL Server 如果有条件可以使用远程连接或者TeamViewer等工具,操作带GUI的数据库管理器,实施起来可以很省心.可以直接查看结果,模板化查询甚至提示语句错误等. 如果是使用li ...

  4. 如何安装mysql 匹配_学习笔记----安装MySQL

    安装MySQL 1.下载解压源代码包. 我的是mysql 5.1.48版本的. 2.添加mysql用户和组 [root@tigertall mysql-5.1.48]#groupadd  mysql ...

  5. pip安装mysql模块_使用pip安装mysql模块for python

    我正在尝试使用pip安装mysql模块for python,但遇到了一个错误:mysqlclient.lib(typelib.obj) : error LNK2001: unresolved exte ...

  6. .frm_.myd_myi转换为.sql导入mysql数据库_把.frm,.myd,myi转换为.sql导入数据库

    ---------------------- Windows Phone 7手机开发. .Net培训.期待与您交流! ----------------------     前几天在黑马论坛上遇到一个网 ...

  7. sqlserver evaluation是什么版本_使用SSMS扫描和查找SQL Server数据库的潜在安全漏洞...

    SQL Server Management Studio 17.4或更高版本的SSMS中提供了SQL Server漏洞侦测(VA)功能,此功能允许SQL Server扫描您的数据库以查找潜在的安全漏洞 ...

  8. ssms没有弹出服务器验证_使用SSMS扫描和查找SQL Server数据库的潜在安全漏洞

    SQL Server Management Studio 17.4或更高版本的SSMS中提供了SQL Server漏洞侦测(VA)功能,此功能允许SQL Server扫描您的数据库以查找潜在的安全漏洞 ...

  9. java程序试岗内容_使用纯 Java 程序为 SQL Server 数据库加载 JDBC 驱动程序,使用()语句...

    [单选题]如果在导游讲解进程中发生意外情况,景区(点)讲解员应及时联络( ),以期尽快得到妥善处理或解决. [多选题]与图文声像导游方式相比,实地口语导游方式将始终处于主导地位的原因有( ). [单选 ...

  10. sqlserver date类型和字符串比较_基于SQL Server数据库搭建主从复制实现读写分离实战演练...

    一.课程介绍 读写分离(主从同步)从字面意思就可以理解,就是把对数据库的读操作和写操作分离开.读写分离在网站发展初期可以一定程度上缓解读写并发时产生锁的问题,将读写压力分担到多台服务器上.读写分离的基 ...

最新文章

  1. 顺序结构,判断结构 if,switch
  2. 对于初学者十条PCB元器件摆放小技巧
  3. GoogleReader的Likes操作数据如何获取?
  4. Delphi 2010 新增功能之: IOUtils 单元(4): TDirectory.GetDirectories
  5. java 学习写架构必会几大技术点
  6. iphone 有关(maybe you meant: _kSecClass$non_lazy_ptr)
  7. C语言指针这些使用技巧值得收藏!
  8. 计算机大致可以分为大型计算机嵌入式系统,计算机类型大致可以分为:大型计算机、、嵌入式系统三类...
  9. 1.3.2 Jetty 的基本配置(2)
  10. 递归——数的计算(洛谷 P1028)
  11. centos 之7zip
  12. baum welch java_Baum Welch估计HMM参数实例
  13. 中航信e-build php,学习PHP精粹,编写高效PHP代码之质量保证
  14. RiskCloud-基于Markov算法精准的FTA、 JSA、FMEA软件
  15. Selenium简单的163邮箱登录实例
  16. 亮道剧学铭:激光雷达系统量产上车没那么容易
  17. 【HDOJ】6441--Find Integer
  18. 图像修复-基本问题和经典方法
  19. R plot图片背景设置为透明_一文学会网络分析——Cooccurrence网络图在R中的实现...
  20. js中用正则表达式判断字符串中是否包含中文和英文

热门文章

  1. elasticsearch基础知识
  2. 文本文件与二进制文件区别 r 与 rb 方式 w 与 wb方式(windows)—————— 开开开山怪
  3. cpufreq 五种模式
  4. 什么是企业邮箱客户端授权码,如何使用?
  5. WeQuant交易策略—EMV
  6. 我们已经开发好了Magento的Ctopay(收汇宝)非3D网关
  7. Python基于随机游走模型的PageRank算法及应用
  8. aop:aspectj-autoproxy /的作用
  9. cout 声明与定义
  10. 我第一个用DirextX做的2D游戏——炮炮兵考眼力