Skip to main content

Notifications

Announcements

No record found.

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!

  • Nya Profile Picture
    Nya 29,056 on at
    RE: NetSuite ODBC driver configuration

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans