Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7837509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:39:55+00:00 2026-06-02T14:39:55+00:00

When I run apache (via xampp) as a standalone server not as a service

  • 0

When I run apache (via xampp) as a standalone server not as a service (on Windows Server 2008)

with the following connection code everything works fine (username and password removed )

$server = "WMS";
$link  = odbc_connect($server,'','');

if (!$link) {
    die('Something went horribly wrong while connecting to MSSQL');
}else {echo('');}

If however I change apache to run as a service in Windows the connection breaks and I get the following error message

    Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] 
Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in 
C:\xampp\htdocs\Dev\well.php on line 30

     Something went wrong while connecting to MSSQL
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:39:56+00:00Added an answer on June 2, 2026 at 2:39 pm

    Please read documentation: http://uk.php.net/manual/en/function.odbc-connect.php

    $server = "WMS"; suggests that you have ODBC alias/data source configured with that name. Error message clearly says that data source with such name (WMS) is not found. On Windows 7/Vista/XP/Server you can configure them at “Start -> Administrative Tools -> Data Sources (ODBC)” — path can be different on older OS. In any case — look for “Microsoft ODBC Data Source Administrator”.

    Instead of using alias, I would recommend (the way I always connect) to use full DSN name, e.g.

    // Microsoft SQL Server using the SQL Native Client 10.0 ODBC Driver - allows connection to SQL 7, 2000, 2005 and 2008
    $link = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password);
    

    In this case everything is part of the script and no external dependencies.

    BTW — instead of using ODBC Functions, I would recommend using PDO & driver specially for MS SQL Server: PDO_SQLSRV — http://uk.php.net/manual/en/ref.pdo-sqlsrv.php (or Microsoft SQL Server Driver for PHP if you prefer old procedural style — http://uk.php.net/manual/en/book.sqlsrv.php )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can run redmine via webrick successfully, however with apache I get the following
I keep getting this error when I call 'tomcat:run'. The plugin 'org.apache.maven.plugins:maven-tomcat-plugin' does not
I've been trying to get MOD_WSGI working on Apache via XAMPP on my Mac
If I run the command via php exec(): It does not work. But if
I'm trying to run a command on a remote server via SSH from a
got my server working with Apache, ran it and everything was peachy. Added an
I've got my Apache server setup and it is handling Flask responses via mod_wsgi.
Under my debian copy, I run a django site runs via apache2 and mod_wsgi.
I need to run Linux-Apache-PHP-MySQL application (Moodle e-learning platform) for a large number of
I run PHP 5.2 on Ubuntu with Apache 2. When I want to serve

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.