VBScript, SQL, Authentication

Posted on 2008-11-13
Last Modified: 2012-05-05
Hello, i'm trying to connect to a SQL server with VBScripting.  I am using the below noted code to open the connection. Problem is, I keep getting "Login Failed for user "test". Reason:Not associated with a trusted sql server connection"

The server authentication is set to windows only. I cannot change it due to the environment it's in. I've created a test account and put it in 2 group. The admin group and application group. Neither has helped. I am open for suggestions on what to do.  I need to get this going so I can run some procedures. :)  Thank you in advance.

set conn = CreateObject("ADODB.Connection")

    conn.ConnectionString = "Provider=SQLOLEDB;" & _

	"Initial Catalog=DBName;" & _

	"Server=ServerName;" & _



Open in new window

Question by:mmitchell57
    LVL 18

    Accepted Solution

    All of my scripts use SQL authentication, so I don't know the answer off the top of my head, but take a look here.  It also depends on the version of SQL..


    Author Closing Comment

    Thank you for the link it's working quite well now. :)  

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now