web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

NetSuite ODBC driver configuration

(0) ShareShare
ReportReport
Posted on by 10

Let me preface this by saying I don't have a lot of experience with LAMP environment. I get around but I have crashed the server a couple times poking around. That said...

I'm installing the NetSuite 64bit ODBC driver on an Ubuntu 14.04.4 box on AWS. I also have the Windows driver which I tried using a WAMP setup. On the WAMP setup on my desktop, I can get the connection to work and can query the NetSuite database. On the server, the ODBC driver is set up properly and I have been able to get it to work using isql using the odbcisql64 that is provided by NetSuite.

ISQL> connect "usr"*"pwd"@netsuite
SQL: connecting to database: netsuite...
Elapsed time 1336 ms.

This means that the DSN is set up properly. When I run the PHP code to access the database using the driver, I get this error:

 Fatal error: Call to undefined function odbc_connect() in /var/www/html/www.xxxxx.com/xxxx/GetNSData_1.php on line 5

My PHP code looks like this:

error_reporting(E_ALL);
ini_set('display_errors', '1');

$conn = odbc_connect("NetSuite", "usr", "pwd");
if (!$conn) { 
    die(' Could not connect: ' . odbc_error()); 
}
$query = odbc_prepare($conn, "Some Query");
$success = odbc_execute($query, array('Data'));
if($success)
    odbc_result_all($query);

So this means that there is a missing package on the LAMP server. I'm not sure exactly sure which ones to install. I've tried a whole bunch including unixODBC and FreeTDS. When I install these packages, I get a different error that says this:

Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/www.xxxxx.com/xxxxxx/GetNSData_1.php on line 6

After fixing the linkage in the odbcinst command to be sure that the driver is installed, then I get an error that tells me nothing. There's no error code or anything- not even an odbc_error() response:

Warning: odbc_connect(): SQL error: [unixODBC], SQL state in SQLConnect in /var/www/html/www.xxxxx.com/xxxxxx/GetNSData_1.php on line 5
Could not connect:

So What I suspect is happening is that some path is not getting to the driver anymore. I've tried things online like this: http://www.debugthat.com/connecting-to-netsuite-using-linux-and-odbc but I'm missing something. I know it has to do with the configuration but I'm not knowledgeable enough to see what I'm missing.

If anyone could give me some help on this I would be eternally grateful! Thanks!

I have the same question (0)
  • Nya Profile Picture
    29,060 on at

    Hi,

    Would you please specify which application you're using in Dynamics?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans