无法在.exe文件中找到数据库文件 [英] couldn't find the database file in the .exe file

查看:155
本文介绍了无法在.exe文件中找到数据库文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我只是用iexpress包装我的vb.net项目只是为了制作.exe文件。

它很好但是当我推出时.exe告诉我文件中不存在数据库。

我将我的数据库文件放在\bin\debug文件夹中。现在告诉我C:\ Users \\ \\Abdueie \ AppData \ Local \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ >
谢谢

Hi all,
I was just using iexpress to wrap up my vb.net project just to make it .exe file.
It went fine but when i launched the .exe it's telling me that the database doesn't exist in the file.
I put my database file in \bin\debug folder.Now it's telling me "C:\Users\Abdueie\AppData\Local\Temp\IXP000.TMP\Database\PayItem.accdb is not a valid path.
What should i do to fix the problem?
Thank you

推荐答案

查找实际文件,并使用它?



认真地,不要依赖应用程序目录中的数据库文件:当你发布到生产环境时,这会产生很大的问题,因为:

1)路径将与你测试的版本不同:所以除非你使用相对于实际Application EXE文件的路径,你不会总是找到它。请记住,用户不必安装在你的位置uggest!

2)应用程序很可能没有访问该文件所需的权限,或者可能没有对其所在文件夹的写访问权限。这是一种安全措施,在后来的操作系统中越来越普遍,以帮助防止特洛伊木马和蠕虫。





相反,请查看将数据库存储在更通用的文件夹中:我应该在哪里存储我的数据? [ ^ ]应该有所帮助。



所有这一切都假设你是直接访问文件,而不是通过SQL:如果你想这样做,你会打开一堆新的蠕虫!
Find the actual file, and use that?

Seriously, don't rely on database files in your application directory: when you release to production this can give enormous problems since:
1) The path will be different from the version you tested against: so unless you are using a path relative to the actual Application EXE file, you won't always find it. Remember that users don't have to install where you suggest!
2) There is a very good chance that the application will not have the required permissions to access the file, or may not have write access to the folder in which it resides. This is a security measure which is becoming more prevalent in later operating systems to help prevent trojans and worms.


Instead, look at storing your db in a more "general purpose" folder: Where should I store my data?[^] should help.

All of this assumes that you are accessing the file directly, not via SQL: you open a whole new can of worms if you are trying to do that!


1。 Liston非常小心你必须在你的代码中设置应用程序路径

2.然后在配置文件中设置路径

3.然后在设置完所有之后你必须创建安装项目并在您必须添加数据库。
1. Liston very carefully u have to set application path in your code
2. Then set path in config file
3. Then after setting all you have to create setup project and in that you have to add your database .


在调试模式下,您的数据库应该在调试文件夹中

请通过

http://vijirajkumar.blogspot.in/2010/03/create-setup-and- deployment-project.html [ ^ ]



1.用于在代码app.path / dbname中设置应用程序路径

2。添加对system.configuration文件的引用。它将配置文件添加到您的应用程序

3.然后根据给定的Link创建新的Setupproject。并按照创建设置。

4。安装项目并查看结果。
In debugging mode your database should be in debug folder
please go through
http://vijirajkumar.blogspot.in/2010/03/create-setup-and-deployment-project.html[^]

1. For setting application path in code "app.path /dbname"
2. Add reference to system.configuration file .It will add config file to your application
3. Then Create New Setupproject as per given Link.And follow create setup.
4. Install project and see the result.


这篇关于无法在.exe文件中找到数据库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆