简体   繁体   English

如何通过installshield附加数据库?

[英]How to attach DB by installshield?

i'm creating an install program by install shield 2010. i have 2 problem: 我正在通过install shield 2010创建安装程序。我有2个问题:

  1. how can i make my installation to install SQLExpress as a prerequisite? 我如何进行安装以安装SQLExpress作为先决条件?

  2. i add the following SQL script in Script tab in installshield SQL script part: 我在installshield SQL脚本部分的“脚本”选项卡中添加以下SQL脚本:

     Use master go CREATE DATABASE [DBClinic] ON (FILENAME =N'%appfolder%ClinicSoftware\\DB\\DBClinic.mdf'), (FILENAME =N'%appfolder%ClinicSoftware\\DB\\DBClinic_1.mdf') FOR ATTACH go 

while installing, it shows the this error: 在安装时,它显示此错误:

  unable to open the physical file "C:\Program files\Clinic\DB\DB.mdf".
  operating system error 2: the system cannot find the file specified (5120)

this path is created during the installation. 此路径是在安装过程中创建的。 when i saw the error i checked the path, and it was there but when i accept the error and installation canceled, the install path vanish too. 当我看到错误时,我检查了路径,它在那里,但是当我接受错误并取消安装时,安装路径也消失了。

if before completing the installation, the install path does not create physically, how can i attach my DB in during installation?!?! 如果在完成安装之前未实际创建安装路径,那么在安装过程中如何附加我的数据库?!?!

I have the same problem when Im trying to attach a .mdf file, I have one solution, it is necessary to specify "Full control" permission for the .mdf and also for the installation directory (for the ´Authenticated users' group), then it worked. 当我尝试附加.mdf文件时,我遇到了同样的问题,我有一个解决方案,有必要为.mdf和安装目录(对于“授权用户”组)指定“完全控制”权限,然后它起作用了。 But i unfortunately need to do attach WITHOUT a permission setting. 但不幸的是,我需要在没有权限设置的情况下进行附加。 :-((( :-(((

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM