$myServer = "sql2008";
//$myUser = "zach";
//$myPass = "pass";
//$myUser = "DOMAIN/zach";
//$myPass = "pass";
//$myUser = "zach@DOMAIN.net";
//$myPass = "pass";
$myUser = "sa";
$myPass = "pass";
$myDB = "Database";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer. Error: " . mssql_get_last_message());
So what i have noticed is that i can connect with SA (server admin) but i can not connect with my user name, which is a domain user that has a lot of permissions.
the only one that is giving me an error message is when the username is zach@DOMAIN.net.
Couldn't connect to SQL Server on sql2008. Error: Login failed for user 'zach@DOMAIN.net'.
that leads me to believe that there must be some setting on the server that allows for logins, but i dont know where to look.
*UPDATE****
So after looking in SQL Server Management Studio, I realized that it accepts logins from the sysadmin server roles group. So i added my AD account to the group, but i was still not able to connect with my user name. i used they three approaches i listed above. is there a fourth option?
That being said, is there a way that i can tell it to connect to a group not sysadmin? for security reason i would prefer not to connect to sysadmin?
The solution that I found was SQL Server did not like the fact that I was trying to use a domain account. I realized that any SQL user account that i created works fine, it is just when I try to use AD accounts it doesn't work.
I am sure that some people will want to use AD, but i don't need it in this situation.
Go to login account properties, there's must be some tab there about status that has grant and deny option... I don't have SQL in this PC. It looks something like this:
http://www.google.com.ph/imgres?q=sql+login+grant&um=1&hl=tl&client=firefox-a&hs=tvs&sa=N&rls=org.mozilla:en-US:official&biw=1366&bih=602&tbm=isch&tbnid=LMuu3zBDlLIn5M:&imgrefurl=http://kb.bizagi.com/Goto50061.aspx&docid=P4HAWWO6mFEFMM&imgurl=http://kb.bizagi.com/Uploads/Images/SQL%2525204.jpg&w=709&h=630&ei=nB63TteSBqWriAexnszxDA&zoom=1&iact=hc&vpx=360&vpy=292&dur=1302&hovh=212&hovw=238&tx=161&ty=115&sig=103098649454558437088&page=1&tbnh=129&tbnw=146&start=0&ndsp=21&ved=1t:429,r:15,s:0
I'm not into Active Directory that much but I have tried adding a
DOMAIN/GROUP
to login account in SQL server. Look at this post, it teaches how to add a login for a group in a domain. How to add Active Directory user group as login in SQL Server