DbiDoRestructure Error 
Author Message
 DbiDoRestructure Error

 Help! Anyone who knows how to add an OLE and Binary field to dBase
with an exisiting table using the BDE API call DbiDoRestructure.

  Using the Borland Example for dBase to add a Blob field with the
sub-field type of fldstDBSOLEOBJ or fldstTYPEDBINARY I get an error
message "Invalid Field Type". The sample code from Borland works fine
with all other Field Types.

  If I use the Table.FieldDefs.CreateTable and have the fields added
to the FieldDefs (ftDBaseOle and ftTypedBinary) before the call to
createtable the table create works fine and the fields appear in the
new table. The problem is I have to add these fields to an existing
table not a new one.

 Does anyone know how to use the DbiDoRestructure to add these two
field types?  I'm using delphi 3.

Thanks



Wed, 18 Jun 1902 08:00:00 GMT  
 DbiDoRestructure Error

Quote:

>   Using the Borland Example for dBase to add a Blob field with the
> sub-field type of fldstDBSOLEOBJ or fldstTYPEDBINARY I get an error
> message "Invalid Field Type". The sample code from Borland works fine
> with all other Field Types.

Look in your Bde.int in \DOC Delphi directory:
{ xBASE types (Physical) }

  fldDBMEMO          = $203;            { Memo          (blob) }
  fldDBOLEBLOB       = $208;            { OLE object    (blob) }
  fldDBBINARY        = $209;            { Binary data   (blob) }

Do not use fldBLOB subtypes:
{ fldBLOB subtypes }

  fldstMEMO          = 22;              { Text Memo }
  fldstBINARY        = 23;              { Binary data }
  fldstFMTMEMO       = 24;              { Formatted Text }
  fldstOLEOBJ        = 25;              { OLE object (Paradox) }
  fldstGRAPHIC       = 26;              { Graphics object }
  fldstDBSOLEOBJ     = 27;              { dBASE OLE object }
  fldstTYPEDBINARY   = 28;              { Typed Binary data }

, use:
  afldDesc[0].iFldType := fldDBMEMO;
  afldDesc[0].iFldType := fldDBOLEBLOB;
  afldDesc[0].iFldType := fldDBBINARY;

Palo

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Wed, 18 Jun 1902 08:00:00 GMT  
 DbiDoRestructure Error

Quote:

>  afldDesc[0].iFldType := fldDBMEMO;
>  afldDesc[0].iFldType := fldDBOLEBLOB;
>  afldDesc[0].iFldType := fldDBBINARY;

>Palo

 That didn't work? Here is what I'm doing now...

procedure TfrmModifyTable.MakeField(aTable : TTable;
                                    aName : dbiName;
                                    aType, aSubType,
                                    aLength : Word; aPercision :Byte);
var
 aFieldRec : ChangeRec;
begin
  aFieldRec.szName := aName;
  aFieldRec.iType := aType;
  aFieldRec.iSubType := aSubType;
  aFieldRec.iLength := aLength;
  aFieldRec.iPrecision := aPercision;
  aTable.Open;
{ use the AddField Example from Borland }
  AddField(aTable, aFieldRec);
end;

{ memo field works all of the time }
MakeField(dbDestination, strTemp, fldBLOB, fldstMEMO, 0, 0);

{ if no previous OLE or Binary field in the table this does not work }

MakeField(dbDestination, strTemp, fldBLOB, fldstDBSOLEOBJ, 0, 0);
MakeField(dbDestination, strTemp, fldBLOB, fldstTYPEDBINARY, 0, 0);

I tried your suggestion of of using other fld's... but still get same
error message?

 afldDesc[0].iFldType := fldDBMEMO;
 afldDesc[0].iFldType := fldDBOLEBLOB;
 afldDesc[0].iFldType := fldDBBINARY;

 If I already have an OLE or Binary field  in the table my original
MakeField works fine.

Any ideas of what I'm missing?




Wed, 18 Jun 1902 08:00:00 GMT  
 DbiDoRestructure Error

Quote:


> procedure TfrmModifyTable.MakeField(aTable : TTable;
>                                     aName : dbiName;
>                                     aType, aSubType,
>                                     aLength : Word; aPercision :Byte);
> var
>  aFieldRec : ChangeRec;
> begin
>   aFieldRec.szName := aName;
>   aFieldRec.iType := aType;
>   aFieldRec.iSubType := aSubType;
>   aFieldRec.iLength := aLength;
>   aFieldRec.iPrecision := aPercision;
>   aTable.Open;
> { use the AddField Example from Borland }
>   AddField(aTable, aFieldRec);
> end;

> { memo field works all of the time }
> MakeField(dbDestination, strTemp, fldBLOB, fldstMEMO, 0, 0);

> { if no previous OLE or Binary field in the table this does not work }

> MakeField(dbDestination, strTemp, fldBLOB, fldstDBSOLEOBJ, 0, 0);
> MakeField(dbDestination, strTemp, fldBLOB, fldstTYPEDBINARY, 0, 0);

> I tried your suggestion of of using other fld's... but still get same
> error message?

>  afldDesc[0].iFldType := fldDBMEMO;
>  afldDesc[0].iFldType := fldDBOLEBLOB;
>  afldDesc[0].iFldType := fldDBBINARY;

>  If I already have an OLE or Binary field  in the table my original
> MakeField works fine.

> Any ideas of what I'm missing?



I think your ChangeRec looks so:
ChangeRec = packed record
    szName: DBINAME;
    iType: Word;
    iSubType: Word;
    iLength: Word;
    iPrecision: Byte;
    end;
Use fldDBMEMO, fldDBOLEBLOB or fldDBBINARY as third parameter of your,
aSubType set to 0:
function MakeField(dbDestination, strTemp, fldDBMEMO, 0, 0, 0);
function MakeField(dbDestination, strTemp, fldDBOLEBLOB, 0, 0, 0);
function MakeField(dbDestination, strTemp, fldDBBINARY, 0, 0, 0);

Palo

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help: BDE Call to DbiDoRestructure

2. Paradox, Referential Integrity, DbiDoRestructure, SQL

3. dbiDoRestructure

4. DbiDoRestructure- Adding passwords to paradox tables

5. dbiDoRestructure

6. DbiDoRestructure more information?

7. DbiDoRestructure ? (Pack a Paradox table)

8. Problems with dbiDoRestructure on Password protected tables?

9. DbiDoRestructure call usage

10. DbiDoRestructure - losing master password

11. How to restructure a table with DbiDoRestructure?

12. Help!?!? DBIDoRestructure Call to reorder fields

 

 
Powered by phpBB® Forum Software