Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP!! Creating ODBC DSN for the SQL Server

Status
Not open for further replies.

dongledell

Technical User
Dec 10, 2002
26
GB
Hi all,

I am trying to learn ASP, and have bought the sams teach yourself in 24 hours. When it comes to setting up the sql server for the database, I follow the instructions...

In the ODBC Data Source administrator I go into System DSN and Add. in the ODBC Microsoft Access Setup, I locate the database to use and hit OK.

back in the OBBC Data Source administrator again in System DSN I Add, SQL Server, Put in a name, description and choose local as the server. As instructed I choose "with SQL Server Authentication", tick "Connect to SQL Server to obtain default settings for etc", put a login ID and Password in, and hit next. I then get the following error:

Connection failed
SQLState: '01000'
SQL Server Error: 10061
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen (Connect()).
Connection Failed:
SQL Server Error: 11
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General Network Error. Check your Network Documentation.

In the book it very helpfully states: "Correct any Errors Received." Great!!!

I am not particularly skilled in either errors or networks, so this has stumped me. I have tried playing with various settings, and although the wording of the error changes slightly, it pretty much adds up to the same thing.

Any help VERY much appreciated.

Dongledell

 
Do you have to use an DSN for connection?

how about a DSN-LESS connection:

ACCESS DB
my_Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\dbroot\test.mdb"

SQL Server
my_Conn.ConnectionString = "Provider=SQLOLEDB;Data Source=testweb;database=catalog;uid=sa;pwd=;"
 
BAH, i really hate those emoticons.

If you can tell what that SQL connection string is:

"Provider=SQLO L EDB;data

Without the spaces of course.
 
I don't really know if I can use DSN-Less or not to be honest!!! I have only just started learning all this stuff, so I am literally following the book letter by letter. What is the difference, and where would it be most noticeable?

Many thanks

Dongle
 
Getting into discussions as to which is better, DSN or DSN-Less is a tail of two cities. I've heard/read some people say DSN-LESS is faster than an ODBC DSN connection. Honestly, I haven't seen much difference either way but i'm not coding APS pages for 20,000 hits a day sites.

Personally, I prefer DSN-Less connections as I'm not dependent on someone else setting up resources for me. Especially if it's an SQL server. If you are using a DSN and you don't have direct access to the machine, you are stuck waiting for someone else to build the DSN.

If you know the server information for the SQL server, i'd go ahead and use the DSN-Less connection.

What does your DB connection code look like now, out of curiousity.
 
Right now my DB connection code doesn't exist!! In the Book I am learning from (which I would seriously recommend people DONT buy if your a newbie like me!) it does not go into connection codes until way after you have the Data Source Administrator set up. Of course, being new to it, I don't know what bit's apply to what and the chap who wrote the book decided not to go into such things as WHY your doing something!
 
OK, time to show just how illiterate in this area I am. After your last post I just tried to find the setup for the SQL server, only I can't even find the SQL server on my computer. Am I:

a) Thick as 2 short planks
b) So out of my depth its laughable
c) all of the above!

Could there be a valid reason I can't find it.....
 
If you want drop me a line millsc@~wmcd.com (remove the ~ from that, don't want it harvested) and I'll see if I can answer some questions for you.

I am not a professional coder, but I can give you some insight perhaps that the book is leaving out.
 
Did you install SQL server? if you didn't, it's not on there. Drop me an email and we'll get you the basics fairly quick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top