Wrox Programmer Forums
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics 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 January 16th, 2007, 12:05 AM
Registered User
 
Join Date: Jan 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database connection

I've just downloaded VB 2005 Express and SQL server 2005 express. Built SQL server database and trying to connect and open DB.My code is:
Public p_conFirst As New SqlConnection()
 p_conFirst.ConnectionString = "Server=bk\;Database=First;Trusted_Connection=True ;"
p_conFirst.Open()
        'error 4060
I was trying different connectionStrings,reinstall
Sql server, but have the same message:” Can not
open database".It's only with SQL server DB.
Maybe somebody have answer
Thanks, Boris


 
Old January 29th, 2007, 09:38 AM
Authorized User
 
Join Date: Nov 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196
Default

The error 4060 means that the user does not have sufficient rights to open the database.



Best Regards,
Earl Francis
 
Old February 11th, 2007, 04:14 PM
Authorized User
 
Join Date: Aug 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubisascends
Default

Also, check your server in the connection string, I believe that a sql server express edition server should read something like bk\SQLEXPRESS;Initial Catalog=First.

Check www.connectionstrings.com to be sure though.

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein
US (German-born) physicist (1879 - 1955)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Connection to Access Database reachsevar ASP.NET 2.0 Basics 1 November 28th, 2007 08:56 AM
Database Connection oneillg PHP Databases 1 October 17th, 2007 04:48 PM
Database Connection kapi.goel SQL Language 2 February 14th, 2006 07:01 PM
database connection Nitin_sharma Classic ASP Databases 1 February 8th, 2005 10:23 AM





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