F fee Unregistered / Unconfirmed GUEST, unregistred user! 1999-11-24 #1 现在我又有一问: 如何实现根据文本框中的内容,用“SELECT 字段名 FROM 数据库名” 语句 替换字段名,以便选择相应字段显示。
S smartkid Unregistered / Unconfirmed GUEST, unregistred user! 1999-11-24 #2 AQuery.SQL.Text := 'SELECT ' + FieldNameEdt.Text + ' FROM ' + TableNameEdt.Text; AQuery.Open;
H Hexi Unregistered / Unconfirmed GUEST, unregistred user! 1999-11-24 #3 Query1.Close; Query1.Sql.Clear; Query1.Sql.Add(Format('SELECT %s FROM %s',[Edit1.Text, Edit2.Text])); Query1.Open;
Query1.Close; Query1.Sql.Clear; Query1.Sql.Add(Format('SELECT %s FROM %s',[Edit1.Text, Edit2.Text])); Query1.Open;
S smartkid Unregistered / Unconfirmed GUEST, unregistred user! 1999-11-24 #4 或: AQuery.SQL.Text := Format('SELECT %S FROM %S', [FieldNameEdt.Text, TableNameEdt.Text]); AQuery.Open;
或: AQuery.SQL.Text := Format('SELECT %S FROM %S', [FieldNameEdt.Text, TableNameEdt.Text]); AQuery.Open;
C Charles Unregistered / Unconfirmed GUEST, unregistred user! 1999-11-24 #5 怎么换了地方? 再贴一次: var Fieldname,Tablename:string; query1.sql.add('select'+Fieldname+' from'+Tablename); Fieldname:='Field1,Field2,Field3'; Tablename:='MyTable'; query1.open;
怎么换了地方? 再贴一次: var Fieldname,Tablename:string; query1.sql.add('select'+Fieldname+' from'+Tablename); Fieldname:='Field1,Field2,Field3'; Tablename:='MyTable'; query1.open;
L Li zhaoyang Unregistered / Unconfirmed GUEST, unregistred user! 1999-11-24 #6 with Query1do begin close; sql.clear; sql.add('select * from '+table1+' where '+edit1.text+'='+edit2.text; query1.open; end;
with Query1do begin close; sql.clear; sql.add('select * from '+table1+' where '+edit1.text+'='+edit2.text; query1.open; end;