jump to navigation

# and chm files…whats the relation ? March 21, 2008

Posted by razasayed in Hacks.
Tags:
add a comment

Some time back i was facing a problem opening windows help files a.k.a. chm files on my XP box . Actually, chm files make use of Internet Explorer for displaying their content, so i checked all the settings in IE but ultimately was at my wits end and was not able to figure out what was going wrong .

After googling on it for sometime i came across some info , which finally helped me solve the problem . It was a strange revelation that if the chm files are placed in a folder which contains the character # in its name , then the chm files wont display their content.

Actually, the chm files on my machine were some docs related to the c# programming language and were placed in a folder that contained the word c# in its name. I renamed the folder by replacing the character # with the word ‘sharp’, and voila, the chm file contents were now visible 🙂 .

For the coders amongst you, the reason is that the # character signifies an anchor in html so the chm file is getting a bit confused as to where to look for the content.  I dont know whether this is officially documented by Microsoft or not , however the moral of the story is never have a # character in the name of a folder that contains chm files. Hope this saves you a lot of trouble in case you run into the same problem.
Alright then, till the next post,

Adios and Happy Hacking ! 🙂

Advertisements

Connecting to SQL Server 2005 Express using PHP March 9, 2008

Posted by razasayed in programming.
Tags:
42 comments

Recently i was trying to connect to a SQL Server 2005 Express database using PHP on a XP machine and i got the following error :

mssql_connect() [function.mssql-connect]: Unable to connect to server…

The 8 steps that i followed to resolve this error are as follows :

1.) Downloaded ntwdblib.dll (version : 2000.80.194.0) from Webzila.com

2.) Copied this dll file to apache\bin

3.) Restarted the apache service by going to Control Panel->Administrative Tools->Services.

4.) Went to “SQL Server Configuration Manager”.

5.) Under “SQL Server Network Configuration” clicked on “Protocols for SQLExpress”.

6.) On the right hand side,right clicked on “Named Pipes” and clicked on Enable

7.) Also, right clicked on TCP/IP and clicked on enable

8.) Restarted the SQL Server Express service. You can do that from the control panel or by issuing the following two commands at the command line :

net stop mssql$sqlexpress

net start mssql$sqlexpress

That was it ! . I was now able to connect to SQL Server 2005 Express 🙂 .

In case it still doesnt work for you try the following :

1) Copy php_mssql.dll to apache\ext.

2) Make sure that in your php.ini file , extension=php_mssql.dll is uncommented.

3) Make sure you are using the right port number in your code. You can find out what port SQL Server is listening on by doing the following :

3.1) Go to “SQl Server Configuration Manager”.

3.2) Under “SQL Server Network Configuration” click on “Protocols for SQLExpress”.

3.3) On the right hand side window, right click on TCP/IP , click on Properties.

3.4) In the new window click on the “IP Addresses” tab

3.5) The value of “TCP Dynamic ports” is the port number that SQL Server is listening on.

I spent a hell lot of time figuring all this out, and i hope that this post saves you all that trouble.

Happy Hacking ! 🙂