Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
function GetRequired(ADOConnection: TADOConnection; tablename:string; fieldname:string):string; var fieldreq: TADODataSet; i: integer; comparefield: integer; output: boolean; begin fieldreq := TADODataSet.Create(nil); fieldreq.Connection := ADOConnection; try ADOConnection.OpenSchema(siColumns,VarArrayOf([Unassigned,Unassigned,tablename,Unassigned]),EmptyParam,fieldreq); for i := 0 to fieldreq.RecordCount-1 do begin comparefield :=AnsiCompareStr(fieldreq.FieldByName('COLUMN_NAME').AsString, fieldname); if comparefield = 0 then begin output := fieldreq.FieldByName('IS_NULLABLE').AsBoolean; if output then fieldreq.Next else result := 'NOT NULL'; end else fieldreq.Next; end; finally fieldreq.Free; end; end;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.