Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
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 September 15th, 2006, 07:29 AM
Authorized User
Join Date: Dec 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB 2005 connect to server 2003 with SQL database

Hi there,

I wanted to ask whether it is a limitation of VB 2005 or am i doing something wrong? I basically am trying to from connect from a PC (PC1) to a .MDF database on a server (running MS Server 2003 Standard Ed). I have created an ODBC Data Source (on the PC1) and MS Access is able to connect to this database and access the tables with no problems. But when I try to code this or use the 'Add new data source' wizard in VB 2005 I get an error message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I have also tried to connect to this by install VB 2005 on the Server, but get the same message so I am guessing it is a limitation of the software or the database is not configured properly. But if that is the case then why can Access access it from across the network?

I understand in sql 2005 the database magement is more flexible with a manager, how can I configure previous versions of SQL server that dont have configuration manager?

Thanks very much for you time and help

Best regards,


Old September 15th, 2006, 09:38 AM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

Guessing here, but I would guess that you are encountering a security issue, not a software limitation.
Old September 19th, 2006, 05:22 AM
Authorized User
Join Date: Dec 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Brian,

Thanks for your reply, i have gone into the enterprise manager and granted access to my username on the domain. however i still cannot access it. I hav also shared the MS SQL Server folder and granted my username with full permissions, this has allowed me to see the MDF before I couldnt go into the folder where it was in. I just cant open it now through VB express. The ODBC connection is fine though.
Can VB Express connect to databases (.MDF) running SQL Enterprise Manager ver 8?

thank you for you time and help.


Old September 20th, 2006, 10:10 AM
Registered User
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I am very new at this but... from what I have seen VB 2005 Express can only connect with the SQL Native client to the localhost. I was also unable to connect to a server running SQL 2005 with VB 2005 Express. I was only able to connect to SQL 2005 Express or my locally installed SQL 2005 Developer's Edition.

If anyone knows another way please let us know...


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to connect sql server 2005 priyan.viji Internet Information Services 1 December 16th, 2008 11:57 AM
reg conn to sql server 2005 from vb.net 2005.. veda SQL Server 2005 2 July 1st, 2008 12:16 AM
SQL Server 2005/ VS 2003 Issues johnalp VS.NET 2002/2003 1 August 3rd, 2006 02:44 AM
SQL Server 2005/ VS 2003 Issues johnalp ADO.NET 0 July 10th, 2006 12:46 PM
Access 2003 project and SQL server 2005 jesseleon Access VBA 3 February 23rd, 2006 12:03 PM

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