Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2010 > BOOK: Professional Visual Basic 2010 and .NET 4
|
BOOK: Professional Visual Basic 2010 and .NET 4
This is the forum to discuss the Wrox book Professional Visual Basic 2010 and .NET 4 by Bill Sheldon, Billy Hollis, Kent Sharkey, Gaston Hillar, Rob Windsor, Jonathan Marbutt; ISBN: 9780470502242
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Visual Basic 2010 and .NET 4 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 April 16th, 2011, 11:27 AM
Registered User
 
Join Date: Apr 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem loading examples.bat for Pubs database

I cannot get the examples.bat file to run. My College instructor has the same problem. The error that I get is:

C:\Documents and Settings\Tscherb1\Desktop\Wrox Book Files>osql -E -n -i example
s.sql
[SQL Server Native Client 10.0]Named Pipes Provider: Could not open a
connection to SQL Server [2].
[SQL Server Native Client 10.0]Login timeout expired
[SQL Server Native Client 10.0]A network-related or instance-specific error
has occurred while establishing a connection to SQL Server. Server is not
found or not accessible. Check if instance name is correct and if SQL Server
is configured to allow remote connections. For more information see SQL Server
Books Online.

Any suggestions?

Toby
 
Old April 20th, 2011, 02:00 PM
Wrox Author
 
Join Date: Jun 2007
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post
Default

Hi Toby,

What is the instance name of your SQL Server? The examples.bat is set up to not use an instance, but if you're just using SQL Express, you'll need to update the call to osql to include this instance. Something like:

osql -E -S .\SQLEXPRESS -n -i examples.sql

Hope that helps.
__________________
TTFN - Kent
 
Old April 20th, 2011, 02:23 PM
Registered User
 
Join Date: Apr 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem loading examples.bat for Pubs database

Kent thanks for your reply. That worked but now I have a new message:

C:\Documents and Settings\Tscherb1\Desktop\Wrox Book Files>osql -E -S .\SQLEXPRE
SS -n -i examples.sql
Msg 2715, Level 16, State 7, Server TSCHERB1-60825B\SQLEXPRESS, Line 1
Column, parameter, or variable #1: Cannot find data type dbo.id.
Msg 4902, Level 16, State 1, Server TSCHERB1-60825B\SQLEXPRESS, Line 2
Cannot find the object "dbo.authors_bulk_copy" because it does not exist or you
do not have permissions.
Msg 4902, Level 16, State 1, Server TSCHERB1-60825B\SQLEXPRESS, Line 1
Cannot find the object "dbo.authors_bulk_copy" because it does not exist or you
do not have permissions.

C:\Documents and Settings\Tscherb1\Desktop\Wrox Book Files>pause
Press any key to continue . . .
 
Old April 21st, 2011, 05:08 PM
Wrox Author
 
Join Date: Jun 2007
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post
Default

Do you also already have pubs installed into that instance of SQL Express?
Also, does your user account have rights to create tables in that instance? (it should have if you installed it, but in a classroom it might not.) If you normally connect to SQL Express using a different user account (like sa), you can change that command-line. It's currently set up to access SQL Server using your credentials (the -E parameter), but you can set it to use another:

osql -U sa -P password etc.
__________________
TTFN - Kent





Similar Threads
Thread Thread Starter Forum Replies Last Post
PUBS Database diston52 BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1 0 May 27th, 2009 03:54 PM
Unable to connect to pubs database... help! scottkhughes BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 1 September 10th, 2008 08:35 AM
Problem with reading BAT file rhysduk VB How-To 0 January 12th, 2005 09:53 AM
Pubs Database pro-logic ADO.NET 0 July 10th, 2003 11:50 PM





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