Autor Beitrag
MaartenVR
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Mi 22.11.06 13:05 
I use Delphi6 and MS SQLserver and had a problem with dbExpress (see below). I posted it at the website of Borland. I wondered if someone has another solution then Borland's work-around.

dbExpress Error: Invalid Field Type, for MS SQL-server query with date-time parameter

We have a MS SQL Server database and we use dbExpress to connect to it (with driver dbexpmss.dll, vendorLib OleDb). When we want to use a query and it has a date-time parameter, we get the error:
“EdatabaseError: dbExpress Error: Invalid Field Type.”
I found a work-around, which in brief says: use TSQLTimeStamp in stead of TdateTime (see bdn1.borland.com/art...,1410,30078,00.html), and indeed this works. The only problem is that we already have a large application which contains a lot of these kind of parameterized queries, so it would take a lot of time to re-program. Our application works fine with Interbase and Firebird as database, but now we have a new customer who wants to use MS SQL-server. When we started building our application, we chose for dbExpress because it claimed to be database-independent, but apparently it’s not. In another similar bug-report (see report 11090) I read that Borland gave this bug the status ‘closed’, but to really forfill the claim about database-independence, this bug should be fixed.
Bernhard Geyer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 721
Erhaltene Danke: 3



BeitragVerfasst: So 26.11.06 17:37 
You can try to use Corelab-Drivers (crlab.com/dbx/).

The problem that you have that non of these technic like BDE, dbExpress, ADO, ... brings you really DB-Intependence because Type-Difference like for Varchar, (Date)Time-Fields will not be 100% wrapped with this Layers.

What you need is a conentrating of the DB-Access in one Unit per DB and using of the Bridge-Pattern.

Perhaps the CoreLabs-Drivers solve this problem for MS SQL. But witht the first user of a Oracle-DB you have to rewrite many code when you didn't encapsulate the DB-Layer with e.g. the Bridge-Pattern.