Board index » delphi » Problems TEXT field in SQL Server (General SQL Error)

Problems TEXT field in SQL Server (General SQL Error)

Hi!
I (and others as well) have had problems with BDE versions, SQL links
and TEXT-fields,
but nobody seems to know what to do, to correct the problem.

If anybody has a working solution, please respond!

The problem is shortly as follows:
- BDE 4.x and SQL Server 6.5 (and corresponding SQL links)
  did handle text-fields correctly.
- Then I upgraded to BDE 5.01 and the
  only (but critical) text field stopped working.
  BDE gives me the "General SQL error" message.
- Then I installed a SQL Server 7.0 on another server.
  With it, the text-field works correctly (in all apps).
  But still no luck with the SQL Server 6.5.
- The same problem persists with upgraded BDE 5.10 version.

The same happens in Borland's SQL Explorer as well,
so the problem is not in the application, but with some
incompatibility with different versions.

I can handle the text-fields directly with a TQuery-component but
not with any VCL-component (I guess anything that goes through
a datasource-component).

Borland/Inprise does not seem to take this problem very seriously,
so if anybody know how to get the text-fields to work with both
SQL Server 6.5 and 7.0, please respond.( 6.5 is enough as well)

Best regards,
M?rten Henrichsom

 

Re:Problems TEXT field in SQL Server (General SQL Error)


I'm using them with both 6.5 and 7.0 with no problem. And
I'm using Delphi 4.02, BDE 5.01 with sql links. The only thing
I have run into is that I have to use them with dbmemo fields
if I use data aware controls and I have to do a convert( as text) if
I issue a straight sql statement.  Other than that I have found them
to work great.

  On your General SQL error message do you get any type of
error number from edbengineerror?

  Good luck,

Craig Baugh

Quote
M?rten Henrichson <m...@aabsoft.pp.fi> wrote in message news:3842742D.E6D38F7C@aabsoft.pp.fi...
> Hi!
> I (and others as well) have had problems with BDE versions, SQL links
> and TEXT-fields,
> but nobody seems to know what to do, to correct the problem.

> If anybody has a working solution, please respond!

> The problem is shortly as follows:
> - BDE 4.x and SQL Server 6.5 (and corresponding SQL links)
>   did handle text-fields correctly.
> - Then I upgraded to BDE 5.01 and the
>   only (but critical) text field stopped working.
>   BDE gives me the "General SQL error" message.
> - Then I installed a SQL Server 7.0 on another server.
>   With it, the text-field works correctly (in all apps).
>   But still no luck with the SQL Server 6.5.
> - The same problem persists with upgraded BDE 5.10 version.

> The same happens in Borland's SQL Explorer as well,
> so the problem is not in the application, but with some
> incompatibility with different versions.

> I can handle the text-fields directly with a TQuery-component but
> not with any VCL-component (I guess anything that goes through
> a datasource-component).

> Borland/Inprise does not seem to take this problem very seriously,
> so if anybody know how to get the text-fields to work with both
> SQL Server 6.5 and 7.0, please respond.( 6.5 is enough as well)

> Best regards,
> M?rten Henrichsom

Re:Problems TEXT field in SQL Server (General SQL Error)


Quote
M?rten Henrichson wrote:
> Hi!
> I (and others as well) have had problems with BDE versions, SQL links
> and TEXT-fields,
> but nobody seems to know what to do, to correct the problem.

This is from MSDN. Hope it helps.

When dealing with BLOB fields from SQL Server, you need to put them to
the right of non-BLOB
   columns in the resultset. To be safe, you should also read the columns
in left-to-right order, so if you
   have two BLOB columns as the last two columns in your resultset, read
the first one and then the
   second. Do not read them in the reverse order
...
   Perhaps a better alternative is to avoid using a Text column. Because
SQL Server allocates space in
   2K chunks, using Text columns may result in inefficient use of storage
if the text length is very small.
   Backup time is also affected because it takes longer to dump the
transaction log. It is often better to
   create another table that has the PK of your existing table, a chunk
number column, and a varchar
   (255) column. Divide the text into as many 255 character chunks needed
and insert as many rows in
   the new table as there are chunks. It is usually worth the additional
coding time since you make more
   efficient use of storage and backups go much faster.
.....
Because this depends on a variety of factors, below is a guide if you are
having problems with BLOB
columns:

     Try a native OLE DB provider instead of an ODBC provid
....

That's MS we all now and love.

Re:Problems TEXT field in SQL Server (General SQL Error)


M?rten,

you could try our SQLQuery. We originally wrote it because of the
limitations in BDE - SQL Server (blob sizes, live and dead queries etc). It
has very few limitations, is generally faster then BDE and consumes much
less memory...

A very good idea, when using blobs, is to always store the blob in a
separate table, with a unique key (we use IDENTITY) that's put in the "data
table". By building a master-detail relationship with these two tables you
can make sure that blobs are only fetched when needed.

You can download a fully functional evaluation version at
http://component-store.com/delphi/download.htm

Thomas Werner
Component Store Ltd. http://component-store.com

M?rten Henrichson <m...@aabsoft.pp.fi> skrev i
diskussionsgruppsmeddelandet:3842742D.E6D38...@aabsoft.pp.fi...

Quote
> Hi!
> I (and others as well) have had problems with BDE versions, SQL links
> and TEXT-fields,
> but nobody seems to know what to do, to correct the problem.

> If anybody has a working solution, please respond!

> The problem is shortly as follows:
> - BDE 4.x and SQL Server 6.5 (and corresponding SQL links)
>   did handle text-fields correctly.
> - Then I upgraded to BDE 5.01 and the
>   only (but critical) text field stopped working.
>   BDE gives me the "General SQL error" message.
> - Then I installed a SQL Server 7.0 on another server.
>   With it, the text-field works correctly (in all apps).
>   But still no luck with the SQL Server 6.5.
> - The same problem persists with upgraded BDE 5.10 version.

> The same happens in Borland's SQL Explorer as well,
> so the problem is not in the application, but with some
> incompatibility with different versions.

> I can handle the text-fields directly with a TQuery-component but
> not with any VCL-component (I guess anything that goes through
> a datasource-component).

> Borland/Inprise does not seem to take this problem very seriously,
> so if anybody know how to get the text-fields to work with both
> SQL Server 6.5 and 7.0, please respond.( 6.5 is enough as well)

> Best regards,
> M?rten Henrichsom

Other Threads