procedure TForm1.ToolButton1Click(Sender: TObject);
: begin
: datasource1.DataSet.First;
: my_field := datasource1.dataset.fieldbyname('Field1').AsString;
: messagebox(0,my_field,'test',0); ----------- line 42
진한 부분이 빠졌습니다.
DBMan 님이 쓰신 글 :
: VB에서 델파이로 막 건너온 초보입니다.
: BDE로 DB를 연결하고, 아래와 같은 코드를 실행시켰더니
: [Pascal Error] test.pas(41): E2010 Incompatible types: 'string' and 'TField'
: [Pascal Error] test.pas(42): E2010 Incompatible types: 'string' and 'PAnsiChar'
: 이런 에러들이 나는군요.
:
: Database는 Access MDB이고 field1은 분명 string인데 (text), 왜 위와 같은 에러가 나는 건가요?
:
: 조언 부탁드립니다. 감사합니다.
: ----------------------------이하 코드
: var
: Form1: TForm1;
: my_field: string ;
: implementation
:
: {$R *.dfm}
:
: procedure TForm1.ToolButton1Click(Sender: TObject);
: begin
: datasource1.DataSet.First;
: my_field := datasource1.dataset.fieldbyname('Field1'); -------- line 41
: messagebox(0,my_field,'test',0); ----------- line 42
|