SQL数据库用户访问问题 [英] SQL database user access problem

查看:120
本文介绍了SQL数据库用户访问问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有点困惑和迷茫,所以对此主题的任何指教都很感激.

我有一个具有用户表的数据库,还有一个将用户添加到该数据库的VB.NET应用程序.
在我的应用程序中添加登录表单并尝试使用表中的这些用户之一访问SQL Server会造成问题.
因此,问题是我是否还需要将此用户也添加到SQL Server的登录名中,或者是否有解决此问题的方法.

我的目的是创建具有多个用户访问权限的应用程序.

即使可以阅读本书(书名)的任何帮助,我也会照做.
我只需要指出正确的方向.

预先感谢您的帮助.

Hello everyone,

I am a bit confused and lost so any pointer on this subject is grateful.

I have a database that has a users table, and a VB.NET application that adds users to this database.
Adding a login form to my application and trying to access the SQL server using one of these users in my table is creating a problem.
So the question is do I need to add this user also to the login in SQL server or is there a solution for this problem.

My purpose is to create an application with multiple users access.

Any help is appreciated even if it''s go read this book (book name), I will do it.
I just need to be pointed in the right direction.

Thank you in advance for your help.

推荐答案

您仍然可以在表中为应用程序和用户使用一个SQL SERVER帐户(例如:tblusers.

在这种情况下,无论用户如何,您的连接字符串都将保持不变

You can still use one SQL SERVER account with your application and users in a table (eg: tblusers.

In that case your connection string will remain the same regardless of the user something similar to this

"Data Source=localhost;Integrated Security=SSPI;" & _
                                                   "Initial Catalog=sample"



并且当用户尝试使用类似于以下内容的脚本登录时,您可能必须进行验证



and you may have to do a validation when the users attempt to login using a script similar to the following

select *
from tblUsers
where username =''bala'' and password=''123''



这只是一个开始的想法....



This is just an idea for you to start with....


这篇关于SQL数据库用户访问问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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