August 24, 2004 at 2:27 am
I am have very little experience with SQL Server 7, therefore I need some help to solve this connection problem that is causing me to have sleepless nights.
I want to establish an ODBC connection to a data source that is configure to accept mixed mode authentication. I am connecting with my WIN NT credentials (username and password). My logging in credentials have been created on both the SQL Server and the data source (WFS). Each time I tried the Server generates this error message:
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user \'
/wfs/search.asp line 11.
Below is the code that is failing:
search.asp
<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim DisplayAsearch, DisplaySsearch, DisplayFMUA
Dim PID
DisplayASearch = False
DisplaySSearch = False
DisplayFMUA = False
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "WFS" (line 11)
PID = "0"
IF (Request.Cookies("PROFILE") <> Session("PID")) AND (Session("PID") <> "") THEN
Response.Cookies("PROFILE") = PID
Response.Cookies("PROFILE").Path = "/wfs/"
Response.Cookies("PROFILE").Domain = Request.ServerVariables("SERVER_NAME")
Response.Cookies("PROFILE").Expires = DateAdd("d", 120, Date)
Response.Cookies("PROFILE").Secure = False
PID = Session("PID")
ELSEIF Request.Cookies("PROFILE") <> "" THEN
PID = Request.Cookies("PROFILE")
END IF
IF PID="" THEN PID="0"
Set RS = Conn.Execute("SELECT * FROM Profile WHERE Profile_ID = " & PID)
IF NOT RS.EOF THEN
IF RS("USER_TYPE") > 2 THEN DisplaySSearch = True
IF RS("USER_TYPE") > 3 THEN DisplayASearch = True
IF RS("USER_TYPE") > 4 THEN DisplayFMUA = True
END IF
RS.Close
%>
It does not work either on my local machine. The user name is always ignored and replace with the allocated number of my workstation.
Help is needed to fix this problem before I loose more hair.
August 24, 2004 at 4:08 am
Code not visible.
The problem might be with the way you give the connection string. I would suggest you to build a connection string this way. Make sure all the files in your computer shows the extension. From your desktop create a new notepad file and rename the same file with extension .udl
Double click it and select the provider, server name and so on.
Then open the file with notepad. You will get the connection string something simmilar to this:
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Northwind;Data Source=EC2PIN109888\ASUEIS
Thanks,
Ganesh
August 24, 2004 at 5:57 pm
Here is the code:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "WFS"
August 25, 2004 at 12:29 am
So you mean the connection is an user dsn.
Have you tested the Test Data source, is that connecting ?
thanks,
Ganesh
August 25, 2004 at 7:59 am
You say the SQL Server is using Mixed Mode authentication and you are trying to login via Windows login. I can think of two reasons why this might not be working.
1. Your SQL Server login is not set for Windows Authentication. Solution: Use Enterprise Manager, expand down to the instance, find Security. Expand that and find Logins. Click on that and in the details (right) window find your login. Right click on that and select Properties. On the general tab you will see which type of authentication YOUR login is using. It needs to be Windows Authentication.
2. Your computer and the SQL Server computer are not on the same network/domain. Windows Authentication requires a trusted network. This basically means that both computers must autheticate the login/password at the same place (usually a domain controller). If your computers are on different networks you will have to set up a trusted network or use SQL Server authentication.
-SQLBill
August 29, 2004 at 5:31 pm
Guys, I have finally found a solution to my the connection problem. Thanks for all the efforts to help.
August 30, 2004 at 7:33 am
What was the solution? Please post it as it might help someone else in the future.
-SQLBill
August 30, 2004 at 1:43 pm
Please post the solution you found.
-- Mark K.
August 30, 2004 at 11:30 pm
Guys, I solved the problem by figuring out that my Personal Web Server and SQL Server should be on the same physical box because the asp file is coded not to generate a connection string. Because the Logon.asp file does not build a connection string I had to log in to the database with the default sa credentials and that is what I did and it worked. I think that it was a design decision that was made at the time that the application was created.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply