Tuesday, March 27, 2012

connecting to sql server

Dear Sirs,
I am working on my first sql server web application. I have read many documents and I have gone to many forums, but i have'nt found any answer. Can you help me please.
Here is my problem:
I can't connect to my database. I use windows authentication and i log in as administrator. I have installed home edition of sql server and IIS is installed in my computer. I use this scripts:

<%
dim objCon
set objCon = server.CreateObject("ADODB.Connection")
objCon.ConnectionString="DSN=dbna.dsn;uid=sa;pwd=;database=na2"
objCon.open
%>

Where dbna.dsn have been defined in "Data Sources (ODBC)" part of control panel.
When I open the my webpage i receive this error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'ALADDIN\IUSR_ALADDIN'.
/dbconnect.asp, line 5

My computer name is ALADDIN and my username is Omid.
Best regards,
Omid.SQL thinks that you are trying to connect using windows authentication. Check the settings on your DSN entry.

As an aside, I would avoid using a DSN entry if you can. Instead, use MS OLE DB for SQL Server.

Check out this web site for some good examples: www.connectionstrings.com.

Regards,

hmscott|||Also, Carl Prothman's Connection String Site (http://www.carlprothman.net/Default.aspx?tabid=81) is pretty handy.|||Thanks alot for your helps but I can't connect to my database yet. I tried OLE DB too but I received the same error. I think something is wrong in my sql server. Can you tell me please what are the main steps for preparing a sql server database.
Regards,
Omid.|||Also, Carl Prothman's Connection String Site (http://www.carlprothman.net/Default.aspx?tabid=81) is pretty handy.
Thanks alot for your helps but I can't connect to my database yet. I tried OLE DB too but I received the same error. I think something is wrong in my sql server. Can you tell me please what are the main steps for preparing a sql server database.
Regards,
Omid.|||Change SQL authentication mode to MIXED if you are trying to log on with sa/pwd mode.|||Change SQL authentication mode to MIXED if you are trying to log on with sa/pwd.|||I don't want to log on with sa/pwd. I want to use windows authentication.

No comments:

Post a Comment