Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2010 > BOOK: Professional Visual Basic 2010 and .NET 4
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old April 20th, 2011, 02:00 PM
Wrox Author
Points: 61, Level: 1
Points: 61, Level: 1 Points: 61, Level: 1 Points: 61, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: Comox, BC, Canada.
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
Reply With Quote
  #3 (permalink)  
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 . . .
Reply With Quote
  #4 (permalink)  
Old April 21st, 2011, 05:08 PM
Wrox Author
Points: 61, Level: 1
Points: 61, Level: 1 Points: 61, Level: 1 Points: 61, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: Comox, BC, Canada.
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 08:53 AM
Pubs Database pro-logic ADO.NET 0 July 10th, 2003 11:50 PM



All times are GMT -4. The time now is 10:58 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.