Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 22nd, 2003, 09:43 AM
Registered User
Join Date: Jul 2003
Location: el, , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default can't connect to database

i'm using the MSDE for my server and i've got this error when i try to display the asp page

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.
/BegASP/Connect.asp, line 29

i got this code for connecting to the database
objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & _
               "User ID=sa;Initial Catalog=Movie;" & _
               "Initial File Name=C:\MSSQL7\Data\Movie2000.mdf"
so what can i do?

Old July 22nd, 2003, 10:11 AM
Friend of Wrox
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post

This "Not associated with a trusted SQL Server connection" error message generally means that you have set-up your db server to only accept Windows logins. Either change that to allow SQL logins too ("Mixed mode"), or change your connection string to use windows authentication (you'll have to make sure your anonymous user has permissions to the db). There are plenty of conn string examples here: http://www.able-consulting.com/ADO_Conn.htm

Generally its not a very good idea from a security point of view to connect a web page as "sa" (especially when there is no password on your sa account).


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to connect database madu Java GUI 1 December 3rd, 2007 11:54 PM
How to connect SQL Database eapsokha Classic ASP Professional 1 March 10th, 2004 04:18 AM
Connect to remote database sankar Pro VB Databases 0 July 31st, 2003 01:43 AM
Connect Database vikaspalic Classic ASP Databases 3 June 5th, 2003 09:02 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.