2 Replies - 1887 Views - Last Post: 13 September 2009 - 07:23 PM Rate Topic: -----

#1 dunk_6   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 03-August 09

VBScript Database Error

Posted 09 September 2009 - 11:02 PM

Hi all,

I have vbscript program that can insert record into database. When i forgot to close the database before running the program, this error occurred "Cannot open database "<database>" requested by the login. The login failed". Why this error happened and how to solved it? Im using MSSQL 2005 Server, and using VBScript WSH, and create the database using VS 2008.

Here is my connection String:
ConnString = "Provider=SQLNCLI; SERVER=.\SQLExpress;AttachDbFilename=F:\Test2.mdf;Database=Test2.mdf; Trusted_Connection=Yes;"



Since i don't know the password and userID, so i didn't put that in the codes. When i looked into the net, they said to change my connection string. Is this the reason why the error occurred?

thank you

This post has been edited by dunk_6: 09 September 2009 - 11:05 PM


Is This A Good Question/Topic? 0
  • +

Replies To: VBScript Database Error

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: VBScript Database Error

Posted 10 September 2009 - 05:54 AM

That error is telling you that the login credentials (username and password) failed.
Was This Post Helpful? 0
  • +
  • -

#3 dunk_6   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 03-August 09

Re: VBScript Database Error

Posted 13 September 2009 - 07:23 PM

View PostPsychoCoder, on 10 Sep, 2009 - 04:54 AM, said:

That error is telling you that the login credentials (username and password) failed.



but im not setting UID and password for the connections string! if i wanna set them, how should i do do that? thx

This post has been edited by dunk_6: 13 September 2009 - 07:24 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1