Progress database connection

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
canadiancoder
Forum Newbie
Posts: 6
Joined: Tue Aug 07, 2007 8:35 am

Progress database connection

Post by canadiancoder »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi Folks,

I'm trying to connect to a local Progress database using the following:

$dbq = "C:/SD20/sims.db";

Code: Select all

if( !file_exists( $dbq ) )
	echo $dbq . " does not exist!";
else
	echo $dbq . " found!";
	
if ( $conn_id = odbc_connect( $dbq, "user", "pwd", SQL_CUR_USE_ODBC ) )
{
	echo $conn_id;
}
else 
{
	echo "Failed to make connection.";
}
The file exists and I confirmed the user name and password are correct. I get the following error:

Code: Select all

SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect...
Can anyone offer a solution?

Thanks!


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

Post by iknownothing »

The ODBC-link must be a System-DNS and not a User-DNS. Configure your ODBC-link and then modify your configuration with regedt32. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC_INI and open your ODBC-link. The field DBQ contains the path to your database. This path must be without Drive-names (e. g. "M:") so change it to "\\Server\folder\database.mdb". This setting is changed each time you modify your ODBC-configuration using the Windows-tool, so make sure you do this afterwards.

Then you go to the Services-Section in your Systemmanagement. Select the properties of your Apache module. In the login-section you have to make sure you login with a valid User-Account for your Network-Server.

Please note that this way you still have no permission to access linked tables within the linked database
copied from: http://au.php.net/odbc_connect
Post Reply