test

progging - To wander about and beg; to seek food or other supplies by low arts; to seek for advantage by mean shift or tricks.
progging - Programmer slang for writing computer code.

fredag 5. august 2011

Dynamically adding a GRAPHIC field to an existing Paradox table

I wanted to add a few new fields to an existing Paradox database table. We already had a method for adding new fields. This is using SQL to add new fields kinda like:

'ALTER TABLE ' + TableName + ' ADD COLUMN ' + Field + ' ' + FieldType

so the FieldType is a string and one of that parameters. So I thought GRAPHIC would be a valid type. But no, it complains with the message "Capability not supported":



According to Embarcadero:
"This error is returned by the BDE when the BDE parses an SQL string to be sent to a server and the syntax of the string is not supported by the BDE"
So, as of now I still don't have a solution to this problem.

NOTE: Using BLOB as FieldName works just fine (but testing this caused other problems...)

EDIT: 2011-08-25
Using MEMO as the type gave the same error. Using BLOB works and actually creates a MEMO field! :)

Only workaround found was to delete the table and create a new one using Delphi TTable class and field type ftGraphic - FieldDefs.Add('Icon', ftGraphic, 0, False);

Useful link for simple SQL coding:
http://www.thedbcommunity.com/index.php?option=com_content&task=view&id=138&Itemid=46
This also mentions under "Unsupported Capabilities" that "There are a number of table modifications which cannot be performed using Local SQL, such as foreign key constraints, range limitations, picture settings, etc."

Ingen kommentarer:

Legg inn en kommentar