p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Visual C++ 2005 (http://p2p.wrox.com/forumdisplay.php?f=139)
-   -   Registering a ODBC database. (http://p2p.wrox.com/showthread.php?t=90786)

bill071 August 30th, 2013 09:15 AM

Registering a ODBC database.
I am learning C++ using Visual Studio 2005 and the book “Beginning Visual C++ 2005” by Ivor Horton. I run windows XP on my machine. By reading the book I have learned about object programming: Classes, class inheritance, constructors, destructors, virtual functions etc. I have also learned a lot about MFC programming. In the book, I have gotten to the part about SQL and relational databases. In the book there is a program example using the Northwind sample database. Per the authors instructions I have down loaded SQL Server 2000. He said that all the installation instructions are found on the download website (I followed the instructions, but am not sure I did everything right). I ran the setup.exe for SQL Server 2000. I needed to supply a password and had to run it using the command prompt: C:\<file path>\setup.exe sapwd=”<password>”. It ran fine.

I then downloaded the SQL Server 2000 version of the Northwind database.

The next step in the book is to register the ODBC data base. I clicked on the ODBC icon in the control panel and got the “ODBC Data Source Administer” dialog window. The book then told me to register the database as a User DSN. So I clicked on that tab. The next step was to click the “Add” button. Before I clicked the add button, I was given three choices: dBase Files with the Microsoft dBase Driver (*.dbf); Excel Files with the Microsoft Excel Driver(*.xls); or MS Access Database with the Microsoft Access Driver(*.mdb). I am not using Excel or Access, so I chose the Microsoft dBase Driver.
The next dialog I got had the title “Create New Data Source”. Here I had to select a driver. “SQL Server” made the most sense to me, so I selected that. When I clicked finish, I got the “Create New Data Source to SQL Service” dialog window. It asked for name, description, and SQL Server. I entered Northwind for the name and description. It did not give me any choices for the SQL Server. I do not know what to enter for that.

I am not sure that I have done all the steps properly, and I searched the internet for answers. There is a lot of technical terminology that I do not understand. I would appreciate it if someone could walk me through this.

*One concern I have is that non of the dialog windows asked for the dataset name for the Northwind database.
*One thing I noticed is that after I did all of the above stuff and rebooted the computer there is a icon in the lower right of my screen. When I hover the mouse over it, I see the message “Running - \\XPS410 – MSSQLServer”. Then I right clicked the icon, selected about, and got “Microsoft SQL Server Service Manager, Version 8.00.760, Copyright 1991-2000.

bill071 September 12th, 2013 06:43 AM

I made some progress
I decided not to use SQL Server 2000. Instead I used SQL Server 2005 Express. SQL Server 2005 Express was much easier to install since it had a GUI interface. When using the “ODBC Database Source Administrator”, I got to the “Microsoft SQL Server DSN Configuration” window. When I clicked next I got the follow message:

Connection failed:
SQLState: '08001'
SQL Server Error: 2
[Microsoft][SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2].
Connection failed:
SQLState: 'HYT00'
SQL Server Error: 0
[Microsoft][SQL Native Client]Login timeout expired
Connection failed:
SQLState: '08001'
SQL Server Error: 2
[Microsoft][SQL Native Client]An error has occured 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.

I looked at the documentation on the internet for this type of problem. All of it talks about how to allow remote connections. I do not have any remote connections. I just have one stand alone PC. I did all that stuff to allow remote connections any ways to see if that helped. It did not. Does anyone have any ideas?

All times are GMT -4. The time now is 07:44 PM.

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