Solved

remote connection to SQL server issue

Posted on 2009-05-09
6
483 Views
Last Modified: 2013-12-14
Im using SQLAPI++ to connect unmanaged c++ to sql.  On local machine works perfect. I can get as many instances open as I need all looking at the SQL, all connections fine.

I then setup sql server 2008 to handle remote connections by enabling  Named Pipes in the configuration manager and restarting as I learned by default it doesnt allow remote connections.

from another machine i want to connect to the database.  I can ping the server CAVIARIS  the code sees the server but the logon fails?  I dont have any passwords, its windows authentification, I dont care about what authentification it has to be so if I need to change tell me.  

It fails by saying Logon failed for user CAVIARIS\Guest  

I want a number of machines to connect to SQL but Im stuck on the connections.  Do I have to do something in Serrver Management studio?  ie do I have to create a logon before I can go to the client machine and logon, is that the basic philosophy of how this works?  

I need a generic logon for any machine that accesses SQL database, Im hoping I dont have to manually create a new one each time as Im trying to make a cluster of servers all see the same database.  Can someone please walk me through a procedure to get me connected.  its XP  machines are in a network workgroup configuration.

Ive tried scores of combinations but I think Im missing a more general point, thanks
0
Comment
Question by:TheMoog
  • 2
  • 2
  • 2
6 Comments
 
LVL 35

Expert Comment

by:David Todd
ID: 24345072
Hi,

Yes you have to do something in SQL Server Management Studio.

You need to create a SQL Login. The SQL Login can use SQL Authentication or Windows Authentication, and in the last case be a Domain User or Domain Group.

The login then needs to be mapped to a user in a database, and given rights to that database. If you use a Domain group, this is a once per new server per new database - then might need some maintenance/adjustment etc.

HTH
  David
0
 

Author Comment

by:TheMoog
ID: 24348014
I think I may already have done the first part.  I created the database in VS 2008.  When I open the datbase in Server Management Studio I can see the login details
Server Type: Database Engine
Server Name: CAVIARIS
Authentification: Windows Authentification
User Name: CAVIARIS\Administrator
No password.

how do you you map the login to a user in a database and give them rights?

Thanks
0
 
LVL 35

Expert Comment

by:David Todd
ID: 24349983
Hi,

In SSMS Query Explorer, go to the database in question, navigate to security and users, right-click and select New User.

You will see other users already there.

I suggest to get started that you ned to make this user a member of db_datareader.

EVERY object will need rights assigned, and while this can be done at the schema level in SQL 2005 and above, it will still need to be done. Please do avoid the temptation of simply making the new user a member of dbo. This is not the sort of permissions you want an ordinary user to have.

Cheers
  David
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 1

Expert Comment

by:Kanchipuramdeena
ID: 24353017
You need to start the SQL Browser service and enable named pipes

For more info.. refer the following url

http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/
0
 

Author Comment

by:TheMoog
ID: 24353672
OK Ive been a few hrs into this, heres where Im at.  With the help of the last post I have managed to get remote connections operational.  I thought I did this with reading from internet and enabling TCPIP but that was only half the story I didnt know about the server browser, so thats all operational now.  

From another machine I can ping the server.  I discovered something called a log file viewer where I can see why the client wont connect.  I have an error message and have looked at the help but Im baffled by what to do?

Error 18456 Severity 14 State 11.  Token based server validation failed with an infrastructure error.  So reading the help it says I do not have permission to login to server.  OK

How do I give myself permissions to loginto my server?

I right clicked on guest -> properties and clicked on every single button to see if thats it but im unsure and maybe causing more drama than just asking you guys?
0
 
LVL 1

Accepted Solution

by:
Kanchipuramdeena earned 250 total points
ID: 24429932
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now