Hello Drupal Programmers,

I want to know how can i get the database from MS SQL SERVER 2005 to mysql .
I have used some code but that is not giving me fruitfull result.

I want to know how to connect from localhost and from real server.

The code is as follows,

global $active_db;
$previous_db = $active_db;
$db_host = "server.mynetwork";
$db_user = "sa";
$db_pass = "admin448";
$dsn = "DRIVER={MySQL ODBC 3.51 Driver};" .
"CommLinks=tcpip(Host=$db_host);" .
"DatabaseName=$db_name;" .
"uid=$db_user; pwd=$db_pass";

$active_db= odbc_connect($dsn, $db_user, $db_pass);
if (!$active_db)
{exit("Connection Failed: " . odbc_error());}
$sql="SELECT * FROM customers";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "

";
echo "

";
echo "

";
while (odbc_fetch_row($rs))
{
$compname=odbc_result($rs,"CompanyName");
$conname=odbc_result($rs,"ContactName");
echo "

";
echo "

";
}

I am waiting for u r comments
odbc_close($conn);
echo "

Companyname Contactname
$compname $conname

";

Comments

Have you try this on FileMaker Pro?

FileMaker Pro 5.5 onwards have an ODBC interface. Was wondering your script works.

Cheers.