SEARCH YOUR SOLUTION HERE  

verifying user details

New to mssql but the following code works fine in access, whereby in mssql it will return a recordset of name and password but wont verify, all I can assume is its something to do with the server settings, does anyone have any ideas

Posted On: Tuesday 20th of November 2012 12:24:35 AM Total Views:  509
View Complete with Replies




Related Messages:

Master databases and new users   (180 Views)
I recently added a new user and roll to a database. I noticed that, when looking at the Master database there are users listed that are also users in other databases on the same server. Do I have to add my new database user to the Master database too
Multi user environment   (191 Views)
I'm using Microsoft SQL Server 2005. I have 4 user looking at the same list, and they can choose any item from the list and update it. What I would love to implement here is that the user when tries to read the same item or update the same item to give them an alert letting them know that another user is using that record, how could I do that. I use a stored procedure to select the list from my SQL Server and to update the information... what would be best approach in this case Code: SELECT * FROM TBLCUSTOMERS Code: UPDATE TBLCUSTOMERS SET companyName = @companyName, AddressLine1 = @addressLine1, addressLine2 = @addressLine2, City = @city, stateId = @stateId, zipCode = @zipCode, countryCode = @countryCode, phoneCityCode = @phoneCityCode, phone = @phone, faxCityCode = @faxCityCode, fax = @fax WHERE COMPANYID = @COMPANYID
Login failed for user NT AUTHORITYNETWORK SERVICE   (181 Views)
hi,i'm just trying to acces a sql data base wihtin an aspx page... that seem very easy..but i have checked my connectionsrting evrything should be all right, login, pwd..."User id=test;password=testpwd;server=localhost;initial catalog=mydb;Trusted_Connection=yes"and i get this message:Login failed for user 'NT AUTHORITYNETWORK SERVICE' what does taht meen, NT Grant Problemsplease help
Creating new users with limited privileges   (191 Views)
Hi My site has been recently hacked with SQL injections and thus I am trying to add new users to ms sql server (one with only the select permission and another with select, insert, update and delete permissions). However, I have come across an error and I am not too sure how to fix it. I originally added the users within plesk control panel and I have SQL Server 2008 Express on my machine so I can actually see the database. The users are there in the database but it seems I have obviously done something wrong - if you need any more info on how I added the users, let me know. I followed http://www.adamwlewis.com/articles/s...ql-permissions to set certain permissions to anon_user (but haven't done anything with auth_user as I don't need to access it yet). I am getting this when trying to access the website: Microsoft OLE DB Provider for SQL Server error '80040e4d' Login failed for user 'anon_user'. /includes/conn2.asp, line 3 This is my connection code: Code: Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Provider=SQLOLEDB; Data Source=plesksql1.ehosting.com; Initial Catalog=DVASC; User ID=anon_user; Password=xxxxxx" My initial connection used cms_user as the User ID (which was set up automatically when I created the database) and that worked fine but that user has all privileges. I have also put this in to the ASP Development forum (in case I have done something wrong with the connection code).
Query for latest blog record for each user   (158 Views)
I have a simple blog system by where users can leave an entry in a diary. I want to list all users along with their latest entry. It seems simple but I just can't do it. DISTINCT doesn't work because I want to get more than 1 field returned but only want the UserID to be distinct. There is a users table, and a diary table eg. Users ID Name 1 Tom 2 Jane Diary ID UserID Entry 1 1 Test 2 2 Test2 3 2 Test3 4 1 Test4 So I want the returned records to be like: ID UserID Entry 3 2 Test3 4 1 Test4 Ie, Each user with one latest diary entry. Any tips would be gratefully received!
Getting Oracle to accept username and password   (192 Views)
Dim conn = New OracleConnection conn.ConnectionString = "Data Source=databasename; User ID=/" Try conn.Open() Catch ex As Exception Response. Write(ex.Message) End Try If conn.State = ConnectionState.Open Then conn.Close() End If conn.Dispose()Here's what I've tried and nada. I receive an "ORA-01017: illegal username and password" error.IdeasI also tried this connection string. conn.ConnectionString = "Data Source=databasename;User ID=OPS$name;Password=pwd"
Table join to fetch details   (180 Views)
everbody, I have table1 userid username 1 peter 2 melissa 3 diedra and table2 userid username 1 peter 2 diedra 3 zach I need to find the entries whose userids are same but the usernames differ i.e. the usernames of userid 2 are different in the 2 tables. What is the query to fetch the results
help extracting user info   (232 Views)
please can anyone help me i have a ipb forum some how i accidently delete my post i have a old backup from 3 week ago how can i extract the post from the backup NOTE: the only post that was deleted was post made by me none of the other member post was deleted i did not want to restore the entire post table beacause i would loose post in the past 3 weeks can anyone help me with a script or anything i can used to extract post of the post table where the poster id is 1 here is a sample INSERT INTO `ibf_posts` VALUES (2, 0, NULL, 1, 'albertldee', 1, 1, '12.8.34.199' INSERT INTO `ibf_posts` VALUES (3, 0, NULL, 4, ' - ', 1, 1, '207.44.154.35 INSERT INTO `ibf_posts` VALUES (4, 0, NULL, 6, 'demarcus', 1, 1, '69.142.131.149 INSERT INTO `ibf_posts` VALUES (5, 0, NULL, 7, 'gottasteu', 1, 1, '65.12.169.41 the post table has about 122000 line like above i just want to extract all the line that has albertldee like line number 1
Setting up a 'basic permissions' user   (214 Views)
Hi I have a website which has an sql server 2005 backend DB. The connection to my DB is using the username and password of an administrator user who has permissions to view everything. Since this is not very safe for my website I want to set up a user who has only read only access to my database and then use the username and password for this user in my connection string. What's the best way to do this I can set up a user for my DB but not sure how I can set their permissions to read only. Also would I need to set up a user for each of my DB's locally or can I just set up a global user and set permissions on a global level
How to executed extended stored procedures as non-sysadmin users????   (324 Views)
Hi , I have a scenario related to SQL 2005 Security, I have created database "db1" as "sa" user. Steps followed 1.Created a "dummy" login 2.Created a "dummy" user,mapped to "dummy" login for "db1" database and made database owner. 3.logged in as "dummy" login and created a stored procedure which contains EXEC xp_cmdshell Statement and while executing the stored procedure, it is throwing below error. Msg 15153, Level 16, State 1, Procedure xp_cmdshell, Line 1 The xp_cmdshell proxy account information cannot be retrieved or is invalid. Verify that the '##xp_cmdshell_proxy_account##' credential exists and contains valid information. 4. Next, what i done is, i have turned on xp_cmdshell feature and created a proxy account using Windows Authentication Account. 5. I Again tried to connect to "dummy" login and tried to execute the stored procedure and now it worked. Now my Question is, what does the below statement do. EXEC sp_xp_cmdshell_proxy_account 'domain\username', 'domain_user_password' What affect is there if i created this new account. I know this would create a Proxy Credential but i am wondering how would the "dummy" user can able to utilize this Proxy Account internally because externally/explicitly am not giving/executing any command to make use of this newly created proxy account. Can anyone please elaborate on how internally this Proxy Account is able to be utilized by the user "dummy" when he is getting logged in. Am just curious about what is happening internally In other words, just want to know how this proxy account is made available to "dummy" user when he is getting logged in. Commands Used to replicate the scenario. Step1 : Create the database as "sa" user use master go CREATE DATABASE db1 go Step2 : Create a login -- create a login "dummy" as "sa" user USE [master] GO CREATE LOGIN [dummy] WITH PASSWORD=N'dummy', DEFAULT_DATABASE=[db1], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF GO Step3 : Create a User in "DB1" database and make him database owner. USE [db1] GO CREATE USER [dummy] FOR LOGIN [dummy] GO USE [db1] GO EXEC sp_addrolemember N'db_owner', N'dummy' GO Step4 : login as "dummy" and create a stored procedure which uses xp_cmdshell and when you try to execute the stored procedure. It will throw an error. CREATE PROC USP_TEST AS BEGIN DECLARE @STR VARCHAR(100) SET @STR = 'GUEST' PRINT @STR EXEC sys.xp_cmdshell 'dir c:\*.*' END EXEC USP_TEST /* GUEST Msg 15153, Level 16, State 1, Procedure xp_cmdshell, Line 1 The xp_cmdshell proxy account information cannot be retrieved or is invalid. Verify that the '##xp_cmdshell_proxy_account##' credential exists and contains valid information. */ Step5 : Enable the xp_cmdshell feature as "sa" user EXECUTE sp_configure 'show advanced options', 1 RECONFIGURE WITH OVERRIDE GO EXECUTE sp_configure 'xp_cmdshell', '1' RECONFIGURE WITH OVERRIDE GO EXECUTE sp_configure 'show advanced options', 0 RECONFIGURE WITH OVERRIDE GO EXEC sys.xp_cmdshell 'dir c:\*.*' Step6 : Now login as Windows Authentication user and try to create a proxy account EXEC sp_xp_cmdshell_proxy_account 'GSPSTRAIL\Administrator', 'mychlocallogin' Step7: login "dummy" user and again try to execute the stored procedure. EXEC USP_TEST Step8: To drop the proxy account, execute the below peice of code. /* -- To drop a Proxy Account -- login as Windows Authentication and execute the below command /* EXEC sp_xp_cmdshell_proxy_account NULL */
New login domain users missings   (196 Views)
I am having trouble adding new domain logins to a SQL server 2000 system. When logging on from my pc I open the new login option in Enterpise manager and select the required domain. of the standard users are there alongside the global groups. What is missing is all of the domain users and the local groups. If I remote on to a server logging on using my credentials I can add the user ok. This does not affect all dba's and is not restricted behaviour to W2k or XP on local machines! Anyone seen this and managed to fix it before. TIA Iain
Comma delimited string in nvarchar, matching with user id   (301 Views)
Okay heres the deal (I hope I can explain this clearly enough while being as breif as I can): I created a trouble ticket system (ASP site using MS SQL) where the trouble tickets were assigned to only one person, but now I need tickets to be assigned to multiple people. So in my ticket table I changed the assigned_to field to nvarchar and the user id's are comma delimited. On the users home page, when they sign into the site I show currently open tickets assigned to that user. Initially my SQL statement looked like this: strSQL = "SELECT t.ticket_id as [Ticket ID], t.priority, t.subject, b.name as [Client] FROM tickets t, users u, business b where u.user_id = t.assigned_to and t.assigned_to = "& session("user_id")&" and t.status = 'In Progress' and b.business_id = t.business_id" Now as the field type has changed I went looking for something to help me sort thru the comma delimited field to find tickets assigned to the logged in user and am somewhat close with this: strSQL = "SELECT t.ticket_id as [Ticket ID], t.priority, t.subject, b.name as [Client] FROM tickets t, users u, business b where u.user_id = t.assigned_to and (CHARINDEX(',"& session("user_id") &",',t.assigned_to)>0 OR CHARINDEX('"& session("user_id") &",',t.assigned_to)=1 OR CHARINDEX(',"& session("user_id") &"',t.assigned_to)=LEN(t.assigned_to)-1) and t.status = 'In Progress' and b.business_id = t.business_id order by b.name, t.ticket_id" or strSQL = "SELECT t.ticket_id as [Ticket ID], t.priority, t.subject, b.name as [Client] FROM tickets t, users u, business b where u.user_id = "& session("user_id") &" and (PATINDEX('%,"& session("user_id") &",%',t.assigned_to)>0 OR PATINDEX('%"& session("user_id") &",%',t.assigned_to)=1 OR PATINDEX('%,"& session("user_id") &"%',t.assigned_to)=LEN(t.assigned_to)-1) and t.status = 'In Progress' and b.business_id = t.business_id order by b.name, t.ticket_id" neither of which work that well as it will return records that aren't assigned to that user at all and I am nto sure why. I just found charindex() and patindex() and barely know how to use them properly. Please help me as I am at my wits end.
Trouble with users   (273 Views)
I'm trying to create users through the security wizard but it keeps saying there was an error creating users -never very specific. Is there any known issue with the security wizard
Is that possible to delete the SA userid   (201 Views)
in sql server how about if i created another administrator level id, and delete this one