Help with my connection to SQL Security database!!!


I am trying to connect to the Security table to authenticate users. It works well on my box when Im logged in but it isnt working when I have another user try to connect or when I try to connect remotely. I get a SQL error on the aspx page (System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON') but I have already removed the anonymous login for IIS and I have the connection string set to SSPI (.ConnectionString = "data source=servername;initial catalog=Security;Connection TimeOut=30;integrated security=SSPI)with the web.configs identity set to impersonate=true />.

Do you have any other ideas or do you know of another way I can authenticate users and get a return value\t\t
Posted On: Tuesday 20th of November 2012 09:11:15 PM Total Views:  332
View Complete with Replies

RELATED TOPICS OF Microsoft SQL Server PROGRAMMING LANGUAGE




Create Parameters DataType help

Hi I am creating a Parameter for my Command Object. In my database, the field is of type ntext with a length of 16. When I use the .CreateParameter method (I am using the shortcut text here..), what is the DataTypeEnum for it Is it adVarChar 16 or what .Parameters.Append .CreateParameter("@strComments", adVarChar, adParamInput, 16) sanctos
VIEWS ON THIS POST

137

Posted on:

Tuesday 20th November 2012
View Replies!

URGENT Help with SQL Server/IIS problem

Ok, heres the story I have a huge web application that I am trying to deploy Application 1 resides on same machine as sql Server Sql Server 2003 running IIS6.0 Application 2 resides on same machine as sql Server Sql Server 2003 running IIS6.0 Application 3 resides on a web server that serves the internet and is referencing the sql server that is on a Virtual Private Network 3 servers are talking via vpn and this has been confirmed. In all 3 cases in the connection string I am specifying Data Source = 192.168.11.5; ..... Application 1 and 2 are deployed and running fine Application 3 1st revision works fine. I made a few changes and now I keep getting this error: "Could not logon User ...." any time I access the database When I revert back to the old version of the software it works on the web server. Help! Why would the same code work on the web server when the sql server is local, and not on the web server when the sql server is not local Could it be a missing support file. any ideas...thanx.
VIEWS ON THIS POST

113

Posted on:

Tuesday 20th November 2012
View Replies!

select statement help

I have a select query statement that is not producing the results i want. I am joining a table (B) to another table (A). Table A will always have one record, but table B may have 0 or more records. If table B has at least one record, one of them will be flaged in a column (bDefault = 1) and the rest (bDefault = 0). What i need to do is select from table A and if there are records in table B get the one with bDefault=1. This has proven to be beyond my skills. Below is the code I have tried so far. What happens when i run it is this: table B has three records for one member (6) and just one for another (3). the querry returns three rows for 6 and one for 3. How ever many records there are in table B for a given member is how many rows are returned by the query. I don't want that. i want to return only one row per member and if they have a row in table b, return only the row from table B where bDefault = 1 and if they don't have a row in table B, to ignore it. Here is the first code I am tried: SELECT P.nMID, P.nAge, (SELECT MI.sURLPath + 't_' + convert(varchar(10),MI.nID) + '.jpg' WHERE bDefault = 1 AND MI.nMID = P.nMID) as sURLPath FROM tblMember_profile P Left Outer JOIN tblMember_Images MI ON MI.nMID = p.nMID WHERE P.nMID IN ('7','6') ORDER BY P.nMID the 2nd querry here produced the same result: SELECT P.nMID, P.nAge, (SELECT MI.sURLPath + 't_' + convert(varchar(10),MI.nID) + '.jpg' WHERE bDefault = 1 AND MI.nMID = P.nMID) as sURLPath FROM tblMember_profile P JOIN tblMember_Images MI ON MI.nMID = p.nMID WHERE P.nMID IN ('7','6') ORDER BY P.nMID and this is the result: 6 22 NULL 6 22 /images/MemImages/t_36.jpg 6 22 NULL 7 27 /images/MemImages/t_51.jpg I tried this too: SELECT P.nMID, P.nAge, (MI.sURLPath + 't_' + convert(varchar(10),MI.nID) + '.jpg') as sURLPath FROM tblMember_profile P JOIN tblMember_Images MI ON MI.nMID = P.nMID WHERE MI.bDefault = 1 AND P.nMID IN ('6','7') ORDER BY P.nMID and it gave me the results i wanted except that if someone does not have a record in table 2, it does not display them at all. it looks like this: 6 22 /images/MemImages/t_36.jpg 7 27 /images/MemImages/t_51.jpg I know this is long and drawn out, but could someone please make a suggestion on how to deal with this
VIEWS ON THIS POST

199

Posted on:

Wednesday 21st November 2012
View Replies!

Urgent! Please help. Can't insert!

I am running SQL2000 on W2k server. Everything was working fine untill sometime yesterday. in a sudden, I was not able to insert into my database table. I can do select, and I can even run sp_columns on the table, but when I try to INSERT, I get the following error ... Server: Msg 208, Level 16, State 3, Line 4 Invalid object name [tablename]. The insert statment should be working fine as they were run before the problem occurs! Has anyone ran into this before Any input is appreciated!
VIEWS ON THIS POST

208

Posted on:

Wednesday 21st November 2012
View Replies!

Need help to export data to EXcel

iam developed a module. but i want to take data backup every week related to that module. for that i want to generate one button. by clicking that button i want to import tat data in to EXCEL file. any one can help me and save me from tis problem.
VIEWS ON THIS POST

388

Posted on:

Monday 26th November 2012
View Replies!

Hi members help

Code: DECLARE @val VARCHAR(12) declare @p tinyint declare @s tinyint SET @val = '918.56JOA' set @p=len(@val)-1 set @s=len(@val) - charindex('.',@val)-3 select @p as p,@s as s select len(@val)-1 precisions select len(@val) - charindex('.',@val)-3 scale SELECT CONVERT(DECIMAL(@p,@s), LEFT(@val,6)) s iam trying to use this code to automatically get the precision and scale from the value but i get the following error please hep Error name Server: Msg 170, Level 15, State 1, Line 15 Line 15: Incorrect syntax near '@p'.
VIEWS ON THIS POST

250

Posted on:

Monday 26th November 2012
View Replies!

Joins and Query...please help

I am trying to figure out how to Create a join on two tables and then query that join... Join SELECT * FROM DatabaseA INNER JOIN DatabaseB ON DatabaseA.Field3 = DatabaseB.Field7 THen once I have the join do I need to run another query pointing to the join SELECT * from DatabaseA.Field3 WHERE Field9 = "435" I am just a bit confused on the the process and what to do in SQL server. I am trying to access tha data on the fly in a 3rd party app....but running SQL statements... I guess qwhat I am asking is do I write two queries Connected to the DB, Join, Query the Join Or is there antoher way. Any thoughts woudl be very appreciated. THanks
VIEWS ON THIS POST

296

Posted on:

Monday 26th November 2012
View Replies!

MS Access to MS SQL - help

, I am about to convert an MS Access database to MS SQL 2005, and I just wondered what equivalents should I use for each field type as I keep seeing mixed opinions and Im not sure at all . If anyone could let me know what these should be in MS SQL 2005 : - ID Autonumber (primary key in ms access) (No Null / No duplicates) - Date field (No Null) - Number field (to hold large numbers) (No Null) - Text field (up to 255 chars) (Nulls allowed) - Memo field (unlimited chars) (Nulls allowed) Your help would be so much appreciated Thankyou, Gia
VIEWS ON THIS POST

130

Posted on:

Monday 26th November 2012
View Replies!

Problem in runnin asp under sql server (2005)windows authentication.plz help!!

i want to run asp under sqlserver 2005 windows authentication .for this i have written the connection string as:- set connadmin = Server.CreateObject("ADODB.Connection") strpath = Request.ServerVariables("APPL_PHYSICAL_PATH") connstr = "Driver={SQL Server}; Server=PERSONAL-AF5588\SQLEXPRESS;Database=cwcom;Trusted_Connectio n=Yes;" 'connstr="Provider=SQLOLEDB;Trusted_Connection=Yes ;Initial Catalog=cwcom;Data Source=PERSONAL-AF5588\SQLEXPRESS;" connadmin.open(connstr) connadmin.cursorlocation = 3 But the erre is coming as Cannot open database "cwcom" requested by the login. The login failed. plz help me
VIEWS ON THIS POST

312

Posted on:

Monday 26th November 2012
View Replies!

Need help to write the query

I need help to write a query. The details of which is given below employee table Empid EmpName EcatID ProjectID 1200 Rama 5 2 1201 Shiva 5 2 1202 arab 6 44 1207 Kumar 3 28 1208 Despande 6 2 1210 Divya 3 50 1230 praveen 1 44 1232 Raghu 1 28 1247 sumitra 1 2 1266 Manoj 1 39 1274 Siddu 2 39 Empskill Table EmpID CourseID SelfRating Evalrating 1201 10 4 - 1202 11 8 7 1202 100 8 - 1200 12 7 7 1207 99 10 9 1207 100 10 8 1207 101 8 8 1207 102 5 5 1207 103 6 4 1207 104 4 4 1274 104 8 8 Result Needed: Empid PMName No Of Subordinates TotalNoofSubjsratedbysubords TotalNoOfEvalRating 1230 praveen 1 2 1 1232 Raghu 1 6 6 1247 sumitra 2 2 1 1266 Manoj 1 1 1 EcatID =1 means he is a Project Manager a PM has a ProjectID, his sub-ordinates have the same ProjectID (thats how you locate them)
VIEWS ON THIS POST

224

Posted on:

Monday 26th November 2012
View Replies!

Query help needed

I've got 3 tables. Contact1 (accountno, company, contact,...) Contact2 (accountno, lastconton, nextaction, meetdateon,...) ContHist (accountno, userid, notes,...) I want to query the company, contact, last contact date, next action, date for next meeting, the userid who last spoke to the person,and the relevant notes they added when speaking to the contact. So, I have this: Code: select distinct c1.company, c1.contact, ch.userid , c2.lastconton, c2.nextaction , isnull(c2.meetdateon, c2.callbackon) as NextConDate , right(replace(replace(replace(cast(ch.notes as varchar(7000)), char(10), ' '), char(13), ''), char(9), ' '), 300) as Notes from contact1 c1 inner join contact2 c2 on c1.accountno = c2.accountno inner join conthist ch on c1.accountno = ch.accountno where ( c2.nextaction like '%Conceptual Pitch%' or c2.nextaction like '%Appointment set%' ) and ( c2.callbackon between dateadd(dd, -7, getdate()) and dateadd(dd, 30, getdate()) or c2.meetdateon between dateadd(dd, -7, getdate()) and dateadd(dd, 30, getdate()) ) order by c1.company This does ALMOST everything I want it to do... except for this one pesky fact: Every time a user adds notes to a contact history, it adds a new row to the ContHist table. I get (for example) 6 rows for "ACME Rockets" in this query since my user talked to ACME Rockets and made notes regarding this contact 6 times. Now, ContHist has a "lastdate" column in datetime format, but I cannot figure out how to only query against the most recent ContHist record for my 3 table join. How do I limit this query so I only get one record for ACME Rockets based upon the most recent "lastdate" field in ContHist
VIEWS ON THIS POST

147

Posted on:

Monday 26th November 2012
View Replies!

Simple SQL statment help required!!

Please can someone tell me how I add a order by statment into the following SQL query Code: SQL_query = "SELECT * FROM players WHERE age = " & request.querystring("age") Cheers, Dan
VIEWS ON THIS POST

287

Posted on:

Monday 26th November 2012
View Replies!

Please help with setting up for OR statement queries

, I have a problem with creating a simple querry that will look at multiple areas in my database and bring a result. Here's what I want: (search term) --> looks under the "products" table and retrives items based on the search term. Needs to look under SKU, manufacturer, title and description - all contained in the "products" table. Here's what I've got: Code: sQuery = "SELECT * FROM products WHERE keywords = ' '" If keywords "" Then 'Split up keywords into individual words keywordArray = Split(keywords, " ") 'Check to see if the keywords describe a SKU Dim i For i=0 to UBound(keywordArray) sQuery = sQuery & "SKU LIKE '" & keywordArray(i) & "'" sQuery = sQuery & " OR " Next 'Next check in the title For i=0 to UBound(keywordArray) sQuery = sQuery & "title LIKE '" & keywordArray(i) & "'" sQuery = sQuery & " OR " Next 'Finally, check the description For i=0 to UBound(keywordArray) sQuery = sQuery & "description LIKE '" & keywordArray(i) & "'" If i UBound(keywordArray) Then sQuery = sQuery & " OR " Next End If If manufacturer "" Then If keywords "" Then sQuery = sQuery & " AND " sQuery = sQuery & "manufacturer = '" & manufacturer & "'" End If sQuery = sQuery & ";" %> Keywords = " " Manufacturer = " " Query = " " No Products Found       Where are my faults Otherwise, can someone post a query system that will do what I need
VIEWS ON THIS POST

357

Posted on:

Monday 26th November 2012
View Replies!

Model Database detached...help!

We detached the model database to move it to another drive, but now we cannot start the SQL Server Service. Can anyone out there help us
VIEWS ON THIS POST

185

Posted on:

Monday 26th November 2012
View Replies!

query help

, I have the following table ClientID | Address | City | State __________________________________ 1 | something | Blah | WV 2 | someblah | Pitt | PA 2 | blahblah | Pitt | PA 3 | other | Mtow | SC 3 | someother | Mtow | SC 3 | somexxxx | Mtow | SC 3 | otherblah | Blah | WV i want the output as : ClientID | Address | City | State __________________________________ 1 | Blah, WV | Blah | WV 2 | Pitt, PA | Pitt | PA 2 | Pitt, PA2 | Pitt | PA 3 | Mtow, SC | Mtow | SC 3 | Mtow, SC2 | Mtow | SC 3 | Mtow, SC3 | Mtow | SC 3 | blah, WV | Blah | WV any suggestions ...
VIEWS ON THIS POST

265

Posted on:

Monday 26th November 2012
View Replies!

help with trigger?

I hope somebody can help me, I have inserted the code for the trigger that if/when dates are changed it sends an email like below, but instead of noting that the field has changed and emailing that I need to email and capture the actual date it was set to and I am not sure how to do this. Could somebody help me with that As you can see the two bottom parts of the trigger code store the data into the appropriate table and then email it. "Dates Altered for Test Record: Inspection Date Supplier: Test Pty Ltd ID: 28" DECLARE @Dates VARCHAR(512) DECLARE @Email VARCHAR(255) DECLARE @RelocateID INT DECLARE @RemovalistNumber INT DECLARE @InspectionDate DATETIME SET @Dates='' DECLARE getRecs CURSOR FOR SELECT a.RelocateID, a.RemovalistNumber FROM INSERTED a OPEN getRecs FETCH NEXT FROM getRecs INTO @RelocateId, @RemovalistNumber WHILE (@@FETCH_STATUS -1) BEGIN SET @Dates='' /* Inspection Date */ IF EXISTS(SELECT * FROM INSERTED a INNER JOIN DELETED b ON (a.RelocateID=b.RelocateID AND a.RemovalistNumber=b.RemovalistNumber) WHERE ISNULL(CONVERT(VARCHAR, a.InspectionDate, 106), '') ISNULL(CONVERT(VARCHAR, b.InspectionDate, 106), '') AND a.RelocateID=@RelocateID AND a.RemovalistNumber=@RemovalistNumber ) BEGIN IF @Dates '' SELECT @Dates=@Dates + ', ' SELECT @Dates=@Dates + 'Inspection Date' END /* If dates have been changed */ IF @Dates '' BEGIN /* Store a note in the RelocateeNotes table */ INSERT INTO RelocateeNotes (RelocateID, DateCom, InputBy, CommentNote) SELECT RelocateID, GETDATE(), 2351, 'Dates Altered for Test Record:' + CHAR(10) + CHAR(10) + @Dates + CHAR(10) + CHAR(10) + ISNULL('Supplier: ' + co.Name + CHAR(10) + CHAR(10), '') + ISNULL('ID: ' + CONVERT(VARCHAR, a.ID), '') FROM INSERTED a LEFT JOIN Companies co ON (a.SupplierID=co.CompanyID) WHERE RelocateID=@RelocateID AND RemovalistNumber=@RemovalistNumber /* Store the details */ SELECT @Dates='Dates Altered for Test Record:' + CHAR(10) + CHAR(10) + @Dates + CHAR(10) + CHAR(10) + ISNULL('Supplier: ' + co.Name + CHAR(10) + CHAR(10), '') + ISNULL('RFQID: ' + CONVERT(VARCHAR, a.RFQID), '') FROM INSERTED a LEFT JOIN Companies co ON (a.SupplierID=co.CompanyID) WHERE RelocateID=@RelocateID AND RemovalistNumber=@RemovalistNumber /* Get the managers e-mail */ SELECT @Email=Email FROM Test.dbo.Managers a INNER JOIN Test.dbo.RelocateeManagers b ON (a.ManagerID=b.IACManagerID) WHERE RelocateID=@RelocateID IF @Email IS NOT NULL EXEC Test.dbo.SendSimpleEmail @Email, 'Removalist Dates Changed', @Dates EXEC Test.dbo.SendSimpleEmail test@test.com', 'Removalist Dates Changed', @Dates END FETCH NEXT FROM getRecs INTO @RelocateId, @RemovalistNumber END DEALLOCATE getRecs
VIEWS ON THIS POST

273

Posted on:

Monday 26th November 2012
View Replies!

need help creating stored procedure

hi , i nid to create a stored procedure which clears the database every 3 months for example on June 1 [sep 1,dec 1, etc] the stored procedure will delete all records dated b4 june 1. i have browse thru different tutorials on the web and have read abt cursors, but i do not know how to use it. could someone kindly give me a head start thanx
VIEWS ON THIS POST

353

Posted on:

Monday 26th November 2012
View Replies!

Need help Installing msde 2000

, I have downloaded MSDE 2000 as recommended from my previous post, thing is, there is no better way of saying this, I really do need a Dummys guide to installing it! I have tried to run setup.exe at which point it says I need to set a SAPWD, then I have read the readme where I have then ran a number of Command prompt strings like : setup SAPWD="AStrongSAPwd" SECURITYMODE=SQL... but then it says I need to go to my Control Panel to install and configure system components... at which point I am completely lost as to what to do, or whether I am doing it right in the first place!! I am very new to MS Sql, as my database is MS Access at the moment, but I need to convert it to MS Sql, so need a program to edit it in, which is what I am not having much success with now (, any help would be so so so much appreciated!
VIEWS ON THIS POST

258

Posted on:

Monday 26th November 2012
View Replies!

can help me pls?

i have this error when i am opening up my asp file can any1 pls help me Error Type: Microsoft OLE DB Provider for SQL Server (0x80040E4D) Login failed for user 'KELVIN_LIM\IUSR_KELVIN_LIM'. /ASPTRYSUCCESS.asp, line 25 it is used to link up to a database in my computer IIS is already set up which is the prob the IIS or SQL
VIEWS ON THIS POST

181

Posted on:

Monday 26th November 2012
View Replies!

need help installing MSDE 2000

I have to do this project for school to make a website something like www.workopolis.com We have to use VS.NET and MSDE2000 I m running winXP pro., have i do have a router, my computer is an AMD 2500+ I installed VS.net its working fine. As i m trying to install MSDE2000 using the instruction my professor gave us which is the following: Using MSDE (SQL Server Desktop Engine) You will need to download and install the MSDE from Microsoft. If you did not do so with the initial install of VS.NET you can get a copy at http://go.microsoft.com/fwlink/linkid=13962. IMPORTANT Use the following instructions to install MSDE. DO NOT use an instance as the backup and restore of your database will not be compatible with the school lab. The MSDE should have the following path: C:\Program Files\Microsoft SQL Server\Mssql Within the MSSQL folder there should be a Binn and Data folder. If your setup is different you will not be able to use the backup and restore database features and will instead have to use attach/detach. Click the Download link to start the download. Do one of the following: To start extracting files required to install MSDE immediately, click Open or Run this program from its current location. To copy the download to your computer for installation at a later time, click Save or Save this program to disk. If you choose Save this program to disk, locate the file where you saved it, and double-click the .exe file to extract all files required to install MSDE on your computer. After extracting the MSDE installation files, open an MS-DOS command prompt and change to the directory where you extracted the files. MSDE extracts to C:\sql2ksp3\MSDE by default. Run the following command to set up MSDE for Visual Studio .NET.: Setup.exe /qb+ DISABLENETWORKPROTOCOLS=1 SAPWD=itm605Everytime i try to install it says MSDE could not be isntalled and to look in error log.i looked there it gives me the following:004-06-21 12:00:41.46 server Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 1)2004-06-21 12:00:41.46 server Copyright (C) 1988-2002 Microsoft Corporation. 2004-06-21 12:00:41.46 server rights reserved. 2004-06-21 12:00:41.46 server Server Process ID is 3508. 2004-06-21 12:00:41.46 server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL\LOG\ERRORLOG'. 2004-06-21 12:00:41.49 server SQL Server is starting at priority class 'normal'(1 CPU detected). 2004-06-21 12:00:41.51 server SQL Server configured for thread mode processing. 2004-06-21 12:00:41.51 server Using dynamic lock allocation. [500] Lock Blocks, [1000] Lock Owner Blocks. 2004-06-21 12:00:41.54 spid3 Warning ****************** 2004-06-21 12:00:41.54 spid3 SQL Server started in single user mode. Updates allowed to system catalogs. 2004-06-21 12:00:41.54 spid3 Starting up database 'master'. 2004-06-21 12:00:42.17 server Using 'SSNETLIB.DLL' version '8.0.766'. 2004-06-21 12:00:42.18 server SQL server listening on Shared Memory. 2004-06-21 12:00:42.18 server SQL Server is ready for client connections 2004-06-21 12:00:42.18 spid5 Starting up database 'model'. 2004-06-21 12:00:42.23 spid3 Server name is 'STABREZ'. 2004-06-21 12:00:42.23 spid3 Skipping startup of clean database id 5 2004-06-21 12:00:42.23 spid3 Skipping startup of clean database id 6 2004-06-21 12:00:42.23 spid3 Starting up database 'msdb'. 2004-06-21 12:00:42.82 spid5 Clearing tempdb database. 2004-06-21 12:00:44.14 spid5 Starting up database 'tempdb'. 2004-06-21 12:00:44.34 spid3 Recovery complete. 2004-06-21 12:00:44.34 spid3 SQL global counter collection task is created. 2004-06-21 12:00:44.42 spid3 Warning: override, autoexec procedures skipped. 2004-06-21 12:02:28.04 spid3 SQL Server is terminating due to 'stop' request from Service Control Manager.I do not know what to do please someone help me very important. Thank you in advance Shams
VIEWS ON THIS POST

246

Posted on:

Monday 26th November 2012
View Replies!