Dealing with a MSSQL database where the ID field is defined as Binary ( 8 ) and using D2007 / ADO. I can open the table and read in data, but I cannot figure out:
1 - how to get the ID value out of this field - when displayed a grid shows this column as (BYTES), if I try to get the value as a variant then as a string I get an empty string TheCompanyID_I_Want:=TABLE1.FieldByName('COMPANY_ID').asXXXXXDataType; ie what datatype XXXXXDataType do I need to use to get the value ?? The best light I could shed on it with Google was a hint that this type might arrive as an array of Bytes - in which case how to process that? 2 - All I want to do with this value is to put in into a subsequent SQL statement on another table to do a further select of all records with this ID.... qryTable2.SQL.Text := 'SELECT * FROM TABLE2 WHERE COMPANY_ID = '+XXXXXDataTypeToString(TheCompanyID_I_Want); Sorry for asking what is probably a dumb question, but its late at night and I am stuck. And as Einstein said "He who asks a question is a fool for a moment - he who doesn't ask a question is a fool forever" John
_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: unsubscribe