| Subcribe via RSS

PHP Unable to Connect to MS SQL Server Express Edition

June 2nd, 2008 | 2 Comments | Posted in Programming

I’ve been struggling for several hours to find out why PHP 5.2.5 didn’t want to connect to MS SQL Server 2005 Express Edition although extension=php_mssql.dll already enabled and phpinfo() is showing MS SQL already active.

I always got this error messages when trying to connect to MS SQL:

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: (local)\SQLEXPRESS in path\mssql.php on line 5

After doing some searching, I got an answer that PHP 5 is using old ntwdblib.dll version. The one that comes with PHP 5.2.5 distribution is version 2000.2.8.0 which seems doesn’t compatible with the new MS SQL Server 2005 Express Edition. I downloaded new dll from http://webzila.com (use the search tool) which is version 2000.80.194.0 and replaced the one on PHP folder with this version.

I use this code to test the connection and its working:

 
echo("Testing MS SQL connection... ");
 
if ($conn = mssql_connect('(local)\SQLEXPRESS', 'user', 'pass'))
{
    echo("Connection succeed");
 
    mssql_select_db('dbname', $conn);
    mssql_close($conn);
}
else
{
    echo("Connection failed");
}

Tags: ,

Importing Multiple CSV Files to MS Access Database

July 4th, 2007 | 2 Comments | Posted in Programming

I got a task to convert a lot of .csv (Comma Separated File) files today. There are hundreds, 970 files to be exact :) of CSV files. MS Access does have feature to import CSV file to its table, but if you want to convert 970 files one by one, it will took a damn long boring time.

Luckily all the CSV files have the same column format, so what I need to do is find how to automate the process instead of doing it in barbaric way (convert it one by one). I know that this is doable with macro script.
More »

Problem Installing OSCommerce

May 31st, 2007 | 2 Comments | Posted in Programming

I was trying to install OSCommerce on my laptop last Wednesday for a web shop project. I download the latest version of OSCommerce from their website here. The version that I downloaded is 2.2 MS 2.

I have Apache 2 web server, PHP 5 and MySQL 5 database server installed on my laptop, so I guess I’m ready to install OSCommerce. I’m totally wrong.. I read the installation guide and it seems so easy to install, you only need to point your browser to http://<domainname>/<oscommerce folder>/install/install.php

More »

Sending Email with SMTP Authentication in C# .NET

April 5th, 2007 | 5 Comments | Posted in Programming

On my current C# .NET project, the user wants to have the application send an email if a new data is being inserted to the database. I search on the MSDN for class that will do this task and I found SmtpMail class.

Using SmtpMail is very simple, first you need to add a reference on your project. You can do this by right clicking on ‘References’ and click ‘Add References’. On ‘.Net’ tab find ‘System.Web.dll’ and add it to your project.

More »

Switch Case in SQL

March 31st, 2007 | 4 Comments | Posted in Programming

Usually when designing a database I often use an integer to save values that represent a string. To make it clear see table below:

Name

Role ID

Markus

1

Jose

2

Anonymous

3

On the table above I use integers to represent role id names, 1 = ‘Administrator’, 2 = ‘User’, 3 = ‘Guest’.

More »

Crystal Report’s Failed To Load Report

September 20th, 2006 | No Comments | Posted in Programming, QnAp Asia

I spend half time of today’s working hours just to do some research on how to solve a problem that happen on software that currently being worked by other team. The software that they currently do is having problem when it’s being run on Microsoft Windows 98. It producing an error that nobody knows what is the cause.

At first we suspect that Crystal Report is causing the problem because some Windows XP that also having the same problem can be fixed by installing Crystal Report component from Visual Studio .NET 2003 installation CDs. But it’s not the case for Windows 98. I can’t install the Crystal Report component from Visual Studio installation CDs, I even can’t run the setup program :(

More »

Python on .NET Framework?

August 27th, 2006 | 2 Comments | Posted in Programming

When I browse on MSDN website I found something interesting on the download section, in that web page I saw ‘IronPython’ link. I wonder what IronPython is, so I clicked on the link and found the description of IronPython from its website:

More »

Find How To Record Sound in C#

June 9th, 2006 | 3 Comments | Posted in Programming, QnAp Asia

This few days I’ve been searching for how to record sound in C#. After doing some searching on the Internet I found DirectX SDK. Unfortunately the documentation and example of DirectX SDK are writen in C/C++ which is diferrent with C# so I get confused on how to implement it in C#.

I’m still searching for an example on the Internet, I hope I can found one that give a good and easy example.

Markus

  1. on June 12, 2006 at 10:15

    It seems that I didn’t go thoroughly on DirectX SDK installation directory as this morning I found an example of C# code for capturing/recording sound in ‘\Samples\Managed\DirectSound\CaptureSound’ directory.

    Although the code not working correctly. I got some error when running it and the program can’t capture sound, but I’m a little bit glad because at least I have an example.

    Markus