I am trying to connect to a ODBC database. I have testing the entry in the ODBC Data Source Administrator and it connects just fine.
Now I have written a short script to connect to the database with php.
Here is my code.
// Set the ariables for database access
$Host = "localhost";
$User = "MyName";
$Password = "XXXXXXX";
$DBName = "Irms";
$TableName = "empmst";
$Link = odbc_connect ($Host, $User, $Password);
// $Query = "SELECT * from $TableName";
// odbc_close ($Link);
As you can see, I have commented out the query and close statements. I am concentrating on the connection only.
When I run the script in the browser, I am getting this error.
Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in
c:\inetpub\wwwroot\dbconnect.php
on line 16
I am not sure what is going on here.😕 Is there anyone that can help me?