首页 > 解决方案 > 使用 sqllocaldb 的 VB Windows 窗体应用程序在非开发计算机上登录失败

问题描述

我创建了一个访问 sqllocaldb 2014 的 Visual Basic 2013 应用程序。无论是在 IDE 中还是从磁盘运行,它都可以在我的开发机器上正确执行我和另一个测试用户。我创建了一个安装程序。

要在另一台机器上安装,我安装 sqlocaldb,创建数据文件夹,将 .mdf 和 .ldf 放入文件夹并运行安装程序。当它访问存储过程时,我尝试的每个用户都登录失败。我有一些从访问表下载数据并将其写入 sqlocaldb 的代码,并且此代码在没有数据库登录失败的情况下运行。

我早在 2016 年就在 VS 2013 c# 中创建了一系列使用 sqllocaldb 2012 的应用程序。上述安装方法我已经使用了数百次,它适用于任何登录机器的用户。我不记得在那一系列节目中有这个问题。

我已将“NT SYSTEM\Authenticated users”添加为登录名和用户,并将它们设为db_owner.

这是我的连接字符串

Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=C:\MYDB\MYDBReporting.mdf;Initial Catalog=MYDBReporting;Integrated Security=True

是否有关于如何执行此操作的指南?

标签: sql-servervb.netdeployment

解决方案


A Crystal reports error led me to look closely at the Crystal setup. The client in this case wants the reports stored on the server so everyone is using the exact same report. My old app kept them local. The login failure was from the server residing Crystal Reports back to the sqllocaldb. The solution was to deploy SQL Server Express on the server and use that as a data source for the Crystal reports and the app.


推荐阅读