Koozali.org: home of the SME Server

Howto: Connect to Microsoft SQL server from SME7

Offline NickCritten

  • *
  • 245
  • +0/-0
Howto: Connect to Microsoft SQL server from SME7
« on: January 20, 2006, 03:12:04 PM »
Hi all,

I have recently manged to get my SME7pre1 box to connect to an MS-SQL (MSSQL) server, and have a PHP application using the database.

I am willing to write a detailed step-by-step if it would be useful... :hammer:

Any Takers?
...
Nick

"No good deed goes unpunished." :-x...

ergozd

Howto: Connect to Microsoft SQL server from SME7
« Reply #1 on: January 21, 2006, 09:21:14 AM »
Hi Nick!

If you've already seen it check http://phprpms.sf.net The have many extensions and also one for mssql, hope this would help out.

Code: [Select]
What is PHPRPMs?

PHPRPMs is a collection of RPM packages that add various PHP extensions to the PHP that you have as a part of your RPM-based Linux Distribution (Red Hat Enterprise Linux, CentOS, WhiteBox or Fedora Core). The advantages of this approach are:

    * you don't have to rebuild PHP from the source if you just need one of the less-frequently used or non-GPL extensions;
    * since you don't rebuild PHP, you get to keep your "factory" PHP packages with all distro-specific patches and, what's more important,
    * you can continue to receive the standard updates for the "factory" PHP packages via RHN / up2date / yum

Offline NickCritten

  • *
  • 245
  • +0/-0
Howto: Connect to Microsoft SQL server from SME7
« Reply #2 on: January 21, 2006, 12:01:54 PM »
hehe.. thanks Ergin... I wish I'd known about that two months ago  :-D


I had tried unsuccessfully to get Interbase support in PHP working numerous times and utterly failed, the extensions said they were installed, phpinfo said they were installed, everything looked good except it just didn't work!

It seems that all the howto's out there assume you are connecting to a firebird server on another linux box, but I was actually trying to connect to an interbase server on a Wintel box, so I didn't have the required library files.

In the end I used unixODBC to do the job, and when the Database peeps decided to move to MSSQL, all I had to do was create the MSSQL driver, create a new DSN for it, and slightly alter my odbcConnect() function.

If anyone is still interested in a Howto: Connect to an MSSQL/Sybase server using unixODBC, please let me know
...
Nick

"No good deed goes unpunished." :-x...

Offline NickCritten

  • *
  • 245
  • +0/-0
Howto: Connect to Microsoft SQL server from SME7
« Reply #3 on: January 21, 2006, 12:05:49 PM »
Actually, as it turns out, the mssql package from phprpms still requires to install freeTDS, and I don't see an rpm for CENTOS, (can you use rpms for RHEL, or FC on CENTOS?)
...
Nick

"No good deed goes unpunished." :-x...


Offline vincentmeek

  • *
  • 29
  • +0/-0
    • Triple Point Solutions
Howto: Connect to Microsoft SQL server from SME7
« Reply #5 on: January 22, 2006, 09:48:31 PM »
By all means create the howto.  Someone else may find it usefull in the future.

Thanks
Vincent Meek
Network Consultant

RonM

Howto: Connect to Microsoft SQL server from SME7
« Reply #6 on: January 23, 2006, 01:15:48 AM »
Actually, I think I may very well find this useful in the pretty near future. I was thinking of connecting MSSQL as a foreign database into MySQL, but it's a lot more elegant to connect directly from perl or php (not to mention saving me the headache of try to figure it out ;-)

If you have a chance to put this how to together, it would be much appreciated. Any interoperability always ends up with major benefits.

Thanks, RonM

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Howto: Connect to Microsoft SQL server from SME7
« Reply #7 on: January 23, 2006, 03:03:02 AM »
Yes, How-to would be good!

Thanks,

Offline NickCritten

  • *
  • 245
  • +0/-0
Howto: Connect to Microsoft SQL server from SME7
« Reply #8 on: January 23, 2006, 09:18:27 AM »
Oki Doki,

I'll have one written in teh next few days :)
...
Nick

"No good deed goes unpunished." :-x...

cubique

FreeTDS installation on SME601
« Reply #9 on: February 01, 2006, 12:22:32 PM »
Quote from: "ergozd"
Check out Dag's repository

http://dag.wieers.com/packages/freetds/freetds-0.63-1.2.el4.rf.i386.rpm
http://dag.wieers.com/packages/freetds/freetds-devel-0.63-1.2.el4.rf.i386.rpm


Hi, I have used the files you have told, also tried prior version, but when install the rpms the following message appears:

libc.so.6(GLIBC_2.3)   is needed by freetds-0.63-1.2.el4.rf

I have SME 6.0.1 box.

I have search the net for similar problems, a lot of explanation, nothing to solve (my) this issue.

What is missing in my SME box installation? What package to install in order to fix this conflict?

Thx in advance for you help.
Eugen

Offline p-jones

  • *
  • 594
  • +0/-0
Howto: Connect to Microsoft SQL server from SME7
« Reply #10 on: February 01, 2006, 12:42:38 PM »
I would very much welcome the HOWTO. I also realise how time can be a vary scarce comodity !!

Rgds
Peter
...

Offline NickCritten

  • *
  • 245
  • +0/-0
Howto: Connect to Microsoft SQL server from SME7
« Reply #11 on: February 01, 2006, 01:08:58 PM »
Hi All,

The Howto is nearly complete, I'll be putting it on my server either today or tomorrow.

Sorry about the delay; Work has been quite busy recently, and one of my databases PHP frontends suddenly developed a load of bugs that I've been battling with.  :hammer:
...
Nick

"No good deed goes unpunished." :-x...

Offline NickCritten

  • *
  • 245
  • +0/-0
Howto: Connect to Microsoft SQL server from SME7
« Reply #12 on: February 01, 2006, 01:48:34 PM »
cubique,
I've not tried this on 6.01, but you need the library file libc.so.6, which is part of the GLIBC package

I can't find a GLIB_2.3 rpm for RH7.3, the closest is 2.25

ftp://fr.rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/glibc-2.2.5-34.i386.rpm

You could give it a go....
...
Nick

"No good deed goes unpunished." :-x...

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: FreeTDS installation on SME601
« Reply #13 on: February 01, 2006, 05:40:06 PM »
Quote from: "cubique"
Quote from: "ergozd"
Check out Dag's repository

http://dag.wieers.com/packages/freetds/freetds-0.63-1.2.el4.rf.i386.rpm
http://dag.wieers.com/packages/freetds/freetds-devel-0.63-1.2.el4.rf.i386.rpm


Hi, I have used the files you have told, also tried prior version, but when install the rpms the following message appears:

libc.so.6(GLIBC_2.3)   is needed by freetds-0.63-1.2.el4.rf

I have SME 6.0.1 box.


You need a RH 7.3 version of those RPMs, not a RHEL4 version. SME 6.x is RH7.3 compatible, SME 7 is RHEL4 compatible.

Offline NickCritten

  • *
  • 245
  • +0/-0
Howto: Connect to Microsoft SQL server from SME7
« Reply #14 on: February 01, 2006, 06:11:04 PM »
Ta da!!

Howto complete.

For the time being it is on my server at home:

http://www.lmeit.co.uk/freetds.html

Please let me know what you think.

I'm going to put it in the howto's section on Contribs.org, then its time for a :pint: methinks  :-D
...
Nick

"No good deed goes unpunished." :-x...