tanveer Posted March 8, 2006 Share Posted March 8, 2006 Hello all,I am new to this combination of php and MSSQL. I have to connect to MSSQL database and for that the web hosting company gave me userid,password and an ip. I can successfully connect to the MSSQL database and can create tables and all other things using the client-network utility and enterprise manager.On testing purpose, I also connected to a local pc in intranet with MSSQL server running on that and tested my php pages. Now, what I want to know is how to connect to that MSSQL server in the internet? Will it work just by changing the IP, username and passwd that web hosting company gave or do I have to do something more? btw its a windows based hosting and as I know php well I was willing to use it as the scripting language instead of asp / asp.NET. Hope I made myself clear.Thanks in advance.-tanveer Quote Link to comment https://forums.phpfreaks.com/topic/4451-how-to-connect-to-mssql-database/ Share on other sites More sharing options...
elsint Posted March 28, 2006 Share Posted March 28, 2006 Well, not an answer but another question :)I am trying to connect a database that is on another server but I can't!I'm trying the code below but can not get it worked.$conn = new COM("ADODB.Connection") or die("Cannot start ADO");$conn->Open("Remote Provider=bla.blablabla.edu; Data Source=name_of_the_database; User ID=blabla; Password=blabla");I would appreciate if you tell me how you connectThanks! Quote Link to comment https://forums.phpfreaks.com/topic/4451-how-to-connect-to-mssql-database/#findComment-21696 Share on other sites More sharing options...
elsint Posted March 29, 2006 Share Posted March 29, 2006 got it solved$conn->Open("DRIVER=SQL Server;SERVER=server_ip;UID=username; PWD=password;APP=;DATABASE=database_name"); Quote Link to comment https://forums.phpfreaks.com/topic/4451-how-to-connect-to-mssql-database/#findComment-21788 Share on other sites More sharing options...
VirM Posted April 10, 2006 Share Posted April 10, 2006 [!--quoteo(post=359496:date=Mar 29 2006, 02:56 AM:name=elsint)--][div class=\'quotetop\']QUOTE(elsint @ Mar 29 2006, 02:56 AM) [snapback]359496[/snapback][/div][div class=\'quotemain\'][!--quotec--]got it solved$conn->Open("DRIVER=SQL Server;SERVER=server_ip;UID=username; PWD=password;APP=;DATABASE=database_name");[/quote]Thank you, it works for me too. Quote Link to comment https://forums.phpfreaks.com/topic/4451-how-to-connect-to-mssql-database/#findComment-25435 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.