1

I'm attempting to export data from Sage 50 database. I have managed to create a connection to the database however whenever I perform a query I have the following error message.

Warning: odbc_exec(): SQLColAttribute can't handle SQL_DESC_OCTET_LENGTH: [S1C00] Driver not capable in C:... on line 4

I have Attempted to change the cursor to SQL_CUR_USE_CODE as suggested on PHP.net

I am also sure it is connecting as when I enter a table name that doesn't exist then I am receiving this error.

Warning: odbc_exec(): SQL error: Table not found, SQL state S0002 in SQLExecDirect in C:... on line 4

$conn = odbc_connect("TestDB", "Manager", "", SQL_CUR_USE_ODBC);
$sql="SELECT * FROM STOCK"; 
$result=odbc_exec($conn,$sql);

Thanks in advance

barbsan
  • 3,418
  • 11
  • 21
  • 28
Mike Stow
  • 38
  • 6

1 Answers1

0

I was having a similar issue with a c# application, but my solution may have some pertinence here and I hate to see someone go through the stress that I did. Here's what I did to fix my issue:

  1. In the ODBC Data Source Administrator, select your Pervasive ODBC Client Interface
  2. Under Data Options select a database name associated with the data source of your CrystalReports.udl file. Make sure the Dictionary location is the Data directory for your company.
  3. Make sure your select statement queries a table that are allowed by the crystal report e.g. Address, Audittr, etc. since not all tables can be queried through the Crystal reports.

Hope that helps!

iverss
  • 106
  • 7