Jump to content

ODBC - Configuring ODBC Drivers - SequeLink - PHP


This topic is 5530 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I need your help. I am at a complete loss about how to configure the SequeLink ODBC driver included in my FileMaker Pro 9 Advanced install disk. I'm on Mac OS X (10.5.6) using FileMaker Pro 9 Advanced running Apache as localhost. I am trying to use the PHP ODBC functions to connect to a local FileMaker database (immigration.fp7). Before you continue, I do not need any help using the ESS or Manage External Datasource features included in versions 9 and 10 of FileMaker. Yes, these features are easy to use - and for that reason I don't need any help with them. Thanks for reading my post!

In short here's what I need:

1.) How do you properly configure the SequeLink ODBC drivers using /Applications/Utilities/ODBC Administrator?

2.) How do you properly add/configure a DSN using ODBC Administrator? (Especially, how do you specify which FileMaker Database file for the DSN to use?)

3.) How do you properly configure a PHP file and call the odbc_connect() function to use this DSN to access the FileMaker Data using ODBC?

I am not having any success with my PHP access (actually the page is completely blank - see my code below) and have searched these forums. There are a variety of answers on here, but no one has offered definitive advice on a solution.

Below I am including my configuration files. And here I will list the things I have tried which haven't worked, that way you don't have to bother suggesting things I've already tried.

1.) Read the FileMaker document entitled "ODBC and JDBC Guide" - especially the chapters "Installing ODBC client drivers" and "Using ODBC to share FileMaker Data." These documents provide absolutely no guidance on how to configure the drivers or how to use the OSX ODBC Administrator to add/configure the drivers or DSNs.

2.) Changed the permissions on the /Library/ODBC/SequeLink.bundle to 755, recursive. (I have not changed the ownership or group perms.) This isn't required, but with the default permission - read/execute for owner, no permission for group or anyone else - I receive the following PHP error:

Warning: odbc_connect() [function.odbc-connect]: SQL error: [iODBC][Driver Manager]Specified driver could not be loaded, SQL state IM003 in SQLConnect in /Library/WebServer/Documents/jbernal/odbc.php on line 20

by chmod'ing SequeLink.bundle to 755, I didn't receive this error.

3.) Toggled between 64 and 32-bit mode in Apache. This is suggested (albeit, in a different context) at:

http://www.actualtechnologies.com/phpsetup.php

When I toggled from 64 to 32-bit mode, I no longer received this error message:

Warning: odbc_connect() [function.odbc-connect]: SQL error: [iODBC][Driver Manager]Specified driver could not be loaded, SQL state IM003 in SQLConnect in /Library/WebServer/Documents/jbernal/odbc.php on line 20

4.) Finally, I've added all of the appropriate permissions to my test file ("immigration.fm7") and enabled all of the appropriate permissions, sharing, ODBC privileges and users to the file. A child could read it.

MY ODBC.INI AND ODBCINST.INI CONFIG FILES:

------------------------------------------------

Can anyone look them over and tell me what edits to make to the files?

(/Library/ODBC/odbc.ini)

[ODBC Data Sources]

OCDLA = Actual Open Source Databases

COREATHL = Actual Open Source Databases

LOCALHOST = Actual Open Source Databases

OCDLA_ShoppingCart = Actual Open Source Databases

fmpro = fmpro9

[fmpro]

Driver = /Library/ODBC/SequeLink.bundle/Contents/MacOS/ivslk20.dylib

Description = FM Database

host = localhost

port = 2399

Username = Admin

Password =

------------------------------

(/Library/ODBC/odbcinst.ini)

[ODBC Drivers]

Actual Open Source Databases = Installed

fmpro9 = Installed

[fmpro9]

Driver = /Library/ODBC/SequeLink.bundle/Contents/MacOS/ivslk20.dylib

Setup =

Host = localhost

Port = 2399

----------------------------

(my test php file using ODBC functions)

(/Library/WebServer/Documents/odbc.php)

putenv("ODBCINSTINI=/Library/ODBC/odbcinst.ini");

putenv("ODBCINI=/Library/ODBC/odbc.ini");

$odbc_dsn = "fmpro"; // replace this with your DSN!!

$odbc_user = "Admin"; // replace with your FileMaker username

$odbc_pass = ""; // replace with your FileMaker password

$handle = odbc_connect($odbc_dsn, $odbc_user, $odbc_pass, SQL_CUR_USE_ODBC);

if( odbc_error($handle) ){

die(odbc_error($handle).': '.odbc_errormsg($handle));

}

$query = "select * from contracts";

$exec = odbc_exec($handle,$query);

$record_count = 0;

while($row = odbc_fetch_array($exec) ) {

$record_count = $record_count + 1;

$data[] = $row; // this will number the array sequentially

}

print_r($data);

odbc_free_result($exec);

Thanks again! Hopefully, someone will have some good advice for me or helpful reference to an external resource.

Thanks,

J Bernal

Link to comment
Share on other sites

  • 2 weeks later...
  • Newbies

Hey, did you figure this out? You need to add ServerDataSource = Your_Database_Name to the odbc.ini file along with the host and the port.

Now, if I could just get PHP to connect. My connection works fine when I test it, but PHP says "Specified driver could not be loaded, SQL state IM003 in SQLConnect" - arrgghhh

Link to comment
Share on other sites

This topic is 5530 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.