connecting to SQL Server Express via ASP (classic)

  • Hi All,

    I'm having trouble getting at SQL Server 2005 Express via ASP code.

    I'm using the following connection string:

    Set objConn = Server.CreateObject("ADODB.Connection")

    objConn = "Provider = SQLNCLI;" & _

    "Data Source = .\SQLEXPRESS;" & _

    "Initial Catalog = myDB;" & _

    "User ID = DB_reader;" & _

    "Password = a#koddkobn5;"

    I keep getting the error:

    Microsoft SQL Native Client (0x80004005)

    Login failed for user 'DB_reader'. The user is not associated with a trusted SQL Server connection

    I have made sure that the user exists in SQLEXPRESS and that server Security is set to SQL Server and Windows Authentication mode.

    Can anyone think of anything I'm missing or that I should try?

    We've lost our SQL Server admin and I'm trying to develop locally using Express while we hunt for a new admin.

    Thanks so much for any assistance you have time to offer.

    Very best,

    Thom Cox

    Medford, MA

  • It looks like you're trying to use a standard (uid & password) rather than a trusted connection to access the database. Try using this pattern for your connection string:

    Driver={SQL Native Client};Server=myServerAddress\SQLEXPRESS;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

    Steve G.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply