Re: Need Local Connection String to SQL Server for Classic ASP

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Can you explain how to do either of these things (or provide a link)?
I am not very conversant with how to do things on a server. I am not
concerned with security, as this is just on my personal computer and I
am trying to put this together so that I can test my programs without
having to do so on the production server.

Thank you -

george


On Feb 20, 5:03 pm, "Sylvain Lafontaine"
<sylvainlafontaine2...@xxxxxxxx> wrote:
You cannot tell which windows account to use in a connection string.  Only
the current user account (and in this case, it would be the account used by
the web server to run the ASP application; most likely this will be either
IUSR_NameOfYourMachine or the IWAM_NameOfYourMachine but it can be something
else depending on your configuration/setup and to use this windows account,
you must specify the parameter Integrated Security=SSPI (or Integrated
Security=TRUE) in your connection string:

"Provider=SQLOLEDB; Data Source = (local); Initial Catalog = Intranet;
Integrated Security=SSPI;"

This means that you must first give access rights to the account that will
be used by IIS (most likely - but not necessarily - either
IUSR_NameOfYourMachine or IWAM_NameOfYourMachine as explained earlier).

An easier solution would be to activate the mixed authentification on your
SQL-Server instance (Windows + SQL-Server Accounts), create a sql-server
account to be used for accessing the database (you can use the sa account
but as this is the super user for SQL-Server, it's not a good idea to keep
going on this way) and use this account in your connection string.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain aei ca (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)

"GLSmyth" <george.sm...@xxxxxxxxx> wrote in message

news:9cc569f0-99e1-4ac2-9206-85ca90cb83b1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I just installed SQL Server Express 2008 on my machine for testing
purposes.  I am using Classic ASP and am having problems figuring out
what the connection string should be.  The following is not working:

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog =
Intranet; User Id = ABCD\GSmyth; Password=12345"

The error I am seeing is:

Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

I definitely have a database established with SQL Server called
Intranet (converted from Access), so I am assuming that the connection
string is not valid.

the "ABCD\GSmyth" portion of the connection string is what I use for
Windows validation.  The database does not have a password.  I tried
leaving out the ABCD\ portion, as well as the password and User Id
without success.

Any help with this would be appreciated.

Cheers -

george

.



Relevant Pages

  • Re: Delegation problems
    ... The connection string uses a variable defined in the web.config. ... the SPN you have on the service account? ... delegate from my web server to the SQL service on the DB server when I ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Cant connect from ASP app
    ... IIS must assign a Windows user account to every request. ... > My SQL server is on one PC, and the ASP web application is on ... > executed simple dotNET program that uses the very same connection string ...
    (microsoft.public.sqlserver.connect)
  • Re: SQL server express 2005 local accounts problem. please help!
    ... The user's XP SP2 computer has sql server xpress 2005 installed, ... account is set with Administrator permissions. ... starting the process for the user instance. ... The connection string I'm using is: ...
    (microsoft.public.sqlserver.setup)
  • Re: Error 80004005 - Database ... does not exist
    ... Can I work the User ID and Password into the connection string instead ... of relying on the userid/password of the account being used to access ... Chet ... > server, which now that I think of it, would not have access to ANYTHING ...
    (microsoft.public.sqlserver.olap)
  • Re: Re-Post - "the trust relationship between this workstation and the
    ... "the trust relationship between this workstation and the primary domain ... only problem is adding a new user account on the station. ... Client computer must use STRICTLY the INTERNAL DNS server which can ... Attr: subschemaSubentry ...
    (microsoft.public.windows.server.active_directory)