Error when reading data out of database (ODBC)

Post found bugs and possible workarounds.
Welskop

Error when reading data out of database (ODBC)

Post by Welskop » 24 Oct 2007, 13:53

Hello,



I have a problem when trying to read data out of a Paradox 7 database (ODBC).



The message I get is the following:



"Paradox:4045[DataDirect][ODBC Paradox Driver]Embedded NULL terminators are not allowed in SQL_C_CHAR parameters. Error in parameter 1"



The problem is that I only get this error when I use a variable in the SELECT statement. When I use a text it is working fine!



Working: Call SalTblPopulate( hWndItem, hSql, "SELECT feld1

FROM tabelle1

WHERE feld2 = 'G0001' " , TBL_FillAllBackground )



Not working: Set strWert = "G0001" (defined as String: strWert)



Call SalTblPopulate( hWndItem, hSql, "SELECT feld1

FROM tabelle1

WHERE feld2 = :strWert " , TBL_FillAllBackground )



Feld2 is defined in the Paradox table as data type "Alpha".



Does anybody here has an idea how to solve this problem?

Jean-Marc Gemperle

Re: Error when reading data out of database (ODBC)

Post by Jean-Marc Gemperle » 29 Oct 2007, 11:29

Hi there,



Yes... We do provide a router for ODBC access mainly for SQLSERVER access all other databases aren't certified with this router and depending the ODBC driver you might have problems. I know about similar problem with POSTGRES and SalTblPopulate().... There are ways to "certify" you hown ODBC driver using DCC.INI ( see CCOD.PDF) but I haven't any experience with it and not sure it would help anyway.



If paradox has an OLEDB provided I would try with it... Also you might try with the MS OLEDB provider for ODBC drivers.... this is a bridge from OLEDB to ODBC and since TD support OLEDB you might be more lucky with it...



Please read about SqlUDL/SqlCreateSession()/SqlCreateStatment() if you want to give it a try.



Hope this helps



Jean-Marc

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest