Create A SQL Server User And Then Apply Permissions?

Dec 12, 2009

I am creating a multi-user application using VB 2005 Pro and SQL Server 2005.I would like to know what your ideas are when it comes to managing user permissions in regard to being able to view, add, edit and delete information in the database? Do you think I should have the end user type in the information into the VB application which then will create an SQL server user and then apply permissions to that security user or should I fine-grain the application by allowing groups to be created and then assigning permissions and users to those groups?

View 3 Replies


ADVERTISEMENT

Create Sql Server User?

Jun 17, 2009

Create Sql Server User

View 4 Replies

SQL Server CREATE USER With Parameters (.net)?

Oct 16, 2010

I'm trying to execute CREATE USER with a given username (via sql parameter)

exec sp_executesql N'CREATE USER @LoginName
FOR LOGIN @LoginName;',
N'@LoginName varchar(5)', @LoginName='myuser'

Heres the code thats generating the above:

Dim myCommand As SqlCommand = New SqlCommand("CREATE USER @LoginName
FOR LOGIN @LoginName;",
ClassDatabaseConnection.CustomInstance)

[code].....

I get and error:Incorrect syntax near '@LoginName'.I think this is due to the parameters being passed as VarChar causing 'MyUser' rather than MyUser Can I not do this with sql parameters?

View 2 Replies

C# - How To Test User Permissions To Database

Aug 21, 2009

I have a simple .NET 3.5 app for changing some database fields using an ODBCDataSet. Now the Feature Creep is asking if I can hide or show tabs and other controls based on the user's database permissions. Ideally, I would like to control the permissions only on the SQL Server using Windows user groups, and the app would not have any built-in authentication or permission system--it simply uses the logged-in user's Windows account for the database connection. So thus it would have to "test" the permissions to determine whether or not to show the tabs for the user. For example, if they have "write" permissions to a certain table, then the tab for editing it would be visible; if not, the tab never loads for them. How can I list or test the user's permissions to the ODBCDataSet?

View 2 Replies

Check/verify SQL Permissions For A User?

Mar 8, 2010

I am writing an Excel addin to read/insert/update/delete SQL data. I am looking for tips or code samples to check if the user running the addin has select/insert/update/delete permissions. this would work on SQL 2000, 2005 and 2008. I have found the following which works for SQL 2005 (and likely 2008, though I have not tested).

Use AdventureWorks
Go
SELECT * FROM fn_my_permissions('Sales.vIndividualCustomer', 'OBJECT');
Go

[code]....

View 2 Replies

Directory Searcher And User Permissions ?

Feb 9, 2011

I've developed a Windows Form application that contains a function where a user will query AD using a users last name in an attempt to get a list of all domain users that contain all or part of the last name. This function works well if the user is an administrator, however in some cases a department manager, who only exist in the Domain User AD group, needs to use this function. When the user with only Domain User rights uses the function all queries come back empty. I can take the same application to another domain and user with just Domain User rights can use the function just fine.

I assume that the first domain that I mentioned might be using Group Policy to prevent Domain Users from making a query against AD.

Is it truly a Group Policy or some other setting within the domain that prevents this?

The current administrator of the first domain I spoke of is fairly new and has no idea of the workings of AD or Group Policy. All domains that I mentioned here I believe are running Windows 2003 Domains.

View 2 Replies

Get User Permissions Or Rights To Run The Setup?

Apr 8, 2011

I am working in VB.Net 2010 framework 2.0. In my application I want to run a Setup.exe with Process.start. I want to know that whether the user who has started the my application is having the rights to run the setup.exe

View 2 Replies

C# - ASP.NET Development Server Permissions And Network Resources?

Sep 17, 2010

My ASP.NET 4.0 Web App is unable to access Network Printers, while debugging on VS 2010. It can access local printers. Seems like it may be a permissions issue. Since VS2010 Debugging runs on ASP.NET Development Server, it must be running under the account I used to log into Windows, right? Does that user need to be added as an Admin in that printers users? Is there any account that I can impersonate to get this working?

View 2 Replies

Sql Server - Roles And Permissions In Windows Forms

Dec 7, 2011

I am wanting to update our current windows forms security to something a lot more flexible. At the moment we have a single column in thew users table which is named 'Access_Level', this field holds an int value (1 to 4) which is then use to determine users access to certain areas of the application. This worked fine when the system was small, but the system is growing rapidly now so I think it is a good time to update the user access and possibly introduce roles.

[Code]...

View 1 Replies

Apply Inputmask In Sql Server 2005

Nov 18, 2009

can we apply the inputmask in sql server 2005 in vb.net?

View 1 Replies

Create A Page That Allows A User To Upload A File Directly To Ftp Server?

Jan 6, 2011

I want to create a page that allows a user to upload a file directly to my ftp server. For some reason when I run the code and try to upload a file I get:

ERROR: Could not find file 'C:Documents and SettingsuserMy DocumentsVisual Studio 2010ProjectsASP.NETuploadASP.NETuploadfile.txt This is not where the file is located. I am fairly new to .NET programming so I may have done some things incorrectly.

Here is my code:

If FileUpload1.HasFile Then
Dim fileExt As String
fileExt = System.IO.Path.GetExtension(FileUpload1.FileName)
fileExt = fileExt.ToLower

[code]....

View 1 Replies

Create MySql User With Store Procedure (Server Mode)

May 17, 2011

I have successfully create a user name = 'root' and host = '127 .0.0.1 ', use the mysql command (client mode) as follow: sql = String.Format("CREATE USER '{0}'@'{1}' IDENTIFIED BY '{2}'; GRANT ALL PRIVILEGES ON *.* TO '{0}'@'{1}' IDENTIFIED BY '{2}' WITH GRANT OPTION;", userName, serverHost, userPassword) When the script above I change it to store procedure (server mode) as below, I found the error as follows: (Error 1064 - You have an error in your SQL syntax; check the manual That corresponds to Yout MySQL server version for the right syntax to use near 'pass' at line 1)

[Code]....

View 1 Replies

Assessing NTFS User Folder Permissions?

Jul 9, 2009

Assessing NTFS user folder permissions

View 4 Replies

Permissions - Code Is Not Running On Restricted User On PC

Feb 27, 2009

I have some code that queries all the printers on our print server and returns a list. I need this code to work so please don't reply with comments asking why I am using it when you can simply type \Server to list the printers (I know this, but need the code to work as part of a larger application). When running the following code on an IT PC with admin rights, it works. When running on a restricted user PC, it doesn't. How can I add permissions in code to elevate the EXE to 'run as administrator'? [Code]

View 14 Replies

VB File Permissions - Cannot Get The Group / User Remove

Jun 13, 2011

I'm writing and application that creates a home folder for a given user. I can set the permissions fine, but on some of the folders I need to remove a specific group/user, "Everyone" would be an example for one of the folders. I can make it so that they are denied from all the permissions on the folder, but I can't actually get the group/user remove.

View 1 Replies

VS 2008 Creating A User And Share Permissions?

Mar 25, 2010

I'm creating an application that works with another I have no control over. My application needs to be able to create a user and change share permissions. Currently I am able to make a share, but I can't figure out how to set access permissions for that share.

The idea is that the newly created user (w/ password) will have permissions on the share I create.

View 1 Replies

Sql Server - Apply The Formula On A Summary Field?

Feb 27, 2012

I am developing an inventory system and I have developed the following function to convert between cartons and pieces.

Public Function convertQTY(ByVal units_case As Integer, ByVal quantity As QTY) As QTY
While quantity.pieces < 0 And quantity.cartons > 0
If quantity.pieces < 0 And quantity.cartons > 0 Then

[Code]....

For example if units/pieces per carton is 144 then the above code converts the pieces into cartons if the number exceeds 144 and if the pieces are less than 0 then the above code subtracts 1 from carton and adds units per carton into the number of pieces. So that the pieces never exceed total number of pieces in a carton and they are never shown to be less than 0.

I want the same effect in summary field in my crystal report. For showing sum of cartons and pieces at the end of each group.

View 1 Replies

Install The DB Automatically With The Application Without Requiring The User To Create A Mysql Server?

Aug 8, 2009

I'm bulding a program that willl work with a database the database is made with mysql.I would like to know if there is a way to install the DB automatically with the application without requiring the user to create a mysql server...the db have more than 5 million records.

View 3 Replies

Way To Use A Table Server Control And Add Rows To It Without Having To Re-create It Everytime User Does Postback?

Aug 1, 2011

Im new to .Net and I wondering if you have to re-create a table server control on every postback. I'm having a problem when a user clicks a button which adds a row to the table. It works fine up to about 50 rows being added then the page is extremely slow. [code]

View 1 Replies

C# - System.IO.Directory.CreateDirectory With Permissions For Only Current User?

Jun 17, 2009

I want the asp application to create a folder that has access only to the account the application was running with (i.e. asp account?)

I actually wanna use this one, but I don't know how to use the "ComputerCurrentAccount" dynamically.

I want to get the current working account.

View 1 Replies

User To Be Able To Highlight Text And Apply An Attribute?

Apr 2, 2009

So - I have some text in an RTF control. I want the user to be able to highlight text and apply an attribute. The following code is placed into a button called BOLD and seems to work nicely:

If rtfText.SelectedText.Length > 0 Then
rtfText.SelectionFont = New Font(rtfText.SelectionFont, FontStyle.Bold)
End If

The code above will turn the selected text bold.

But then the user selects the Same text and with the following code placed into a button called ITALIC it removes the bold attribute and replaces it with italics.

If rtfText.SelectedText.Length > 0 Then
rtfText.SelectionFont = New Font(rtfText.SelectionFont, FontStyle.Italic)
End If

Since the users actions are separate - I can not know that they want BOLD and ITALIC, so how do I make sure I keep the existing attribute on the selected text (which, by the way could be part bold and part not-bold) and add italic?

Somehow I need to add the italic attribute to the selected text, not simply replace all attributes with italic.

View 1 Replies

Cannot Create ActiveX/CreateObject(). - Permissions?

Jun 30, 2011

I am troubleshooting a program that normally works, and has worked in the past on the machine I am working with.I am a very novice programmer, I didn't program this myself I am just trying to get it to work.I have done as much research as I can, which has lead me to believe it is permissions problem with the CreateObject command.I have tried a fix in the .net 2.0 machine.config file, changing the processModel user to System, that didn't help.The machine does have norton on it, and norton was installed since the program stopped working. However I have tried disabling norton and running the program. A friend suggested it might be some settings on the computer that Norton changed hence disabling it not helping.Here is the error:See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.[code]... When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

View 2 Replies

.net - How To Check If User Has Full Control Permissions On A Shared Folder

Oct 25, 2011

I use the following code in order to check if certin user exists in the DACL:

Dim l_managemantObject As ManagementBaseObject() = CType(securityDescriptor.Properties("DACL").Value, ManagementBaseObject())
For Each mObject As ManagementBaseObject In l_managemantObject
l_name = CType(mObject.GetPropertyValue("Trustee"), ManagementBaseObject).Properties("Name").Value.ToString
If CType(mObject.GetPropertyValue("Trustee"), ManagementBaseObject).Properties("Domain").Value IsNot Nothing Then

[Code]...

View 1 Replies

C# - Using Evidence, Security Policy And Permissions To Prevent Assembly From Loading On Web Server?

Mar 11, 2010

Assume a .NET class library code that, for example, writes to the Windows registry. Then this code has problem to run over internet, because default Internet policy does not give access to write to the registry.By adding a RequestMinimum statement in the assembly we can specify that the code requires permission to write to write to the registry. This will not alter the fact that the code does not have the permission, but will stop the assembly from loading; the runtime will throw a System.Security.Policy.PolicyException and identify the permission that is required.Do you now any other examples of using evidence, security policy and permissions (the key elements of code-access security) to prevent an assembly from loading on a web server?

View 1 Replies

Allow A User To Browse For A Bmp Image To Apply To A Form Background?

Apr 10, 2009

I am already familliar with applying an image to a form background. My application has many in it, but I want to give the user the option of browsing for an image of their own to apply to a form. I don't intend to save the images as defaults or anything. Just the option to browse and apply to a form.

View 6 Replies

Apply Colour Formatting To A Richtextbox *as User Types*?

Oct 18, 2010

I have a RichTextBox with an OnChanged event. The OnChanged event should look at each line in the RichTextBox and if the line is of prime length colour it red, otherwise colour it black. How do I do this? I think it is possible to select from index a to index b and set selection colour, but I think this will lose my cursor position.

View 2 Replies

Apply For Each Loop On An Array Of User Defined Class?

Jul 18, 2011

I was knowing that For Each loop can only be applied to those classes that implement IEnumerable interface . But recently i accidentally wrote a code that is using For Each on my class's objects collection and my that class is not implementing IEnumerable interface .Below is the sample code that i am testing on :

Sub Main()
Dim personList() As Person = New Person(2) {}
personList(0) = New Person("s1", "s2")

[code].....

View 4 Replies

C# - Enable The User To Apply A Custom Filter To A System.Data.DataTable?

Feb 16, 2012

I 'd like to enable the user to apply a custom filter to a System.Data.DataTable.At the moment I have a very simple function like this:

Dim result = dataTable.Select(txtUserInput.Text)

With the filtered results I'd like to do further operations(e.g. Database Update/Delete).Is an sql injection protection needed or is the "Select" function secure?


//Edit:Can the "select" function be abused to manipulate any data in the datatable, execute code, ...? If the only danger is that this function can return to much/to less data there is no problem. But if the data in the dataset gets corrupted it's a real problem.

View 3 Replies

.net - Apply Common Codes In Inherited BaseEdit For Inheriting Classes - In Order To Build A Read Only User?

Feb 20, 2012

In businesslayer, there is a inherited Class Called BaseEdit which contains contractor and base properties. There are about 30 CustomEdit (inheriting classes), all of them has methods "Load","Save" and "Delete". The require for this existing system is to add a readonly user. Possible solutions considering the cost of works:

1) Modify the BaseEdit so all CustomEdit can stay the same. The system will check 'user role' in session by using httpcontext then to accept or reject the user's action.

[Code]...

View 1 Replies

Create An Application That Connects To A SQL Database To Populate A Datagrid - Getting An Error 'remote Connection Permissions' ?

Sep 25, 2009

I am using VB 2008 Express and have created an application that connects to a SQL database to populate a datagrid.The application is working properly on my computer but will not on others 'remote connection permissions' error.After some googleing I found that the express version is crippled to only work on local machines that use a database.If I purchase Visual Studio 2008 Standard Edition, import and rebuild my application, will my application be able to run properly on other PC's?

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved