2

I have a 4D database that I'm trying to get data from (and export to an SQL DB) using their ODBC Driver.

Most of the tables I can read, so I know the driver works.

But I have 5 tables that throw 4 diferent exceptions in the Fill method of the OdbcDataAdapter.

  1. an exception with an empty message
  2. duplicate column exception(in the doc OdbcDataAdapter Fill should be able to overcome this)
  3. ERROR [S1000] [Simba][Simba ODBC Driver][Codebase File Library]
  4. Attempted to read or write protected memory

I'm reading MS documentation, but I dont have access to 4D documentation.

My hope is that someone here as had some experience with this kind of situation and can point me in the right direction.

Thanks in advance.

Noctis Skytower
  • 21,433
  • 16
  • 79
  • 117
Ricardo Gomes
  • 1,268
  • 2
  • 15
  • 35
  • 1
    Aparently the ERROR [S1000] [Simba][Simba ODBC Driver][Codebase File Library] Exception happens when trying to read a field of type image, although I still cannot find why that happens. Just for info to anyone with the same problem. – Ricardo Gomes Jan 09 '12 at 11:33

2 Answers2

1

There are certain data types in 4D that will cause problems. For example I know blob, interval, and int64 can be trouble.

On thing you can do though is cast the fields into VARCHAR in your select statement to 4D.

Like:

SELECT Field1, Field2, CAST(ProblemField AS VARCHAR) FROM MyTable

What version of the driver are you using? I've been using 12.02 but I know there are newer versions that have fixed some bugs, I'm just not sure how to get ahold of them.

CHS
  • 965
  • 2
  • 18
  • 29
0

I'd agree that the 4D ODBC driver is very particular.

Specifically it requires strong type casting. IE CAST(1 as boolean) for boolean values.

4D also has specific data types picture in addition to blob. See below links

http://docs.4d.com/4Dv14R4/4D/14-R4/Principles-for-integrating-4D-and-the-4D-SQL-engine.300-1733038.en.html

List all the 4D System tables that have schema information http://docs.4d.com/4Dv14R4/4D/14-R4/System-Tables.300-1733035.en.html

James
  • 119
  • 1
  • 8