Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases 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 3rd, 2005, 10:15 AM
Registered User
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to Pubs DB on SQL server..easy !!!

Hi every1...
im new to programming so xcuse my dumbness
im doing beginning VB.net 2003ch16, the DataBase Programming with SQL server.
ive downloaded and installed SQL server, its running in my task bar. i
have xp. i set a password when SQL srv installed, through a command
prompt. My xp pc is called "HPPC"
SQL server is installed on the same pc as vb.net 2003 professional.

im trying to run the 'dataset example' try it out, i think i have
problems with this parameter:

Dim objConnection As SqlConnection = New _
SqlConnection("server=(local);database=pubs;user id=sa;password=")

Please tell me:
do i have to change these values with my own username and password?
also, where IS the pubs database? is it in vb.net already or in SQL server?
Hope u guys can help!

Old January 7th, 2005, 03:39 AM
Registered User
Join Date: Dec 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

Don't excuse !
We've all been new to programming not so long ago !

Take a first step:

If you run visual studio:
You have a server explorer window, probably to the left of the screen. There you can try to connect to the databases installed. Your server's name is probably either "(local)", "(local)\the name of your instance of MSDE" ie: "(local)\MYMSDE" or "(the name of your PC)\(the name of your instance)" ie: "MYMACHINE\MYMSDE". Use windows integrated security. If you get the server name right, you can see the databases in the combobox below. You can also test the connection. From there it is much easier to help you with the connectionstring

Old January 12th, 2005, 04:40 PM
Registered User
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

hmm..thanks for the reply:)
i know the name of the server, it is listed in the server window..its 'hppc' .
how do i change this line:
Dim objConnection As SqlConnection = New_
SqlConnection("server=(local);database=pubs;user id=sa;password=")

and make it use integrated security?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting existing program to SQL Express DB jscammell VB Databases Basics 2 April 19th, 2007 02:03 PM
URGENT:Connecting SQL server through Proxy server abhowal SQL Server 2000 3 November 30th, 2005 04:22 AM
connecting web server and remote db server via asp moreyt Classic ASP Databases 0 May 31st, 2005 12:13 AM
Connecting to a DB from another server... dungey PHP Databases 1 May 7th, 2004 11:13 AM
connecting to SQL DB through a domain janeprime2001 C# 2 April 22nd, 2004 07:21 AM

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