易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi中数据库查询的疑惑

昨晚在Delphi数据库查询中遇到了一个疑惑。代码如下:

procedure TFormSearchAchievement.ComboBoxXYChange(Sender: TObject);
var
  XY : string;
begin
  XY := comboboxxy.Items[comboboxxy.Itemindex];
  if not adoconnection1.Connected then
  try
  adoconnection1.Open;
  except
  end;
  adoquery1.Close;
  adoquery1.SQL.Clear;
  adoquery1.SQL.Add('select 专业名称 from Speciality where 学院 =: XY');
  try
  adoquery1.Open;
  except
  end;
  ComboBoxZy.Items.Clear;
  while (not adoquery1.Eof) do
  begin
  ComboBoxzy.Items.Add(adoquery1.FieldValues['专业名称']);
  adoquery1.Next;
  end;

end;

 运行得到的结果是:

郁闷啊~我查看了,数据库的就是那两个列表名啊!怎回事啊?有谁能告诉我?
解决了~~!我太不熟悉了~!!
adoquery1.SQL.Add('select 专业名称 from Speciality where 学院 ='''+XY+'''');
晕~~

procedure TFormSearchAchievement.ComboBoxXYChange(Sender: TObject);
var
  XY : string;
begin
  XY := comboboxxy.Items[comboboxxy.Itemindex];
  if not adoconnection1.Connected then
  try
  adoconnection1.Open;
  except
  end;
&nb


相关问答:

Python中的Unicode在Delphi如何还原成Gb2312?

已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试

在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......

ACCESS的自定义函数在delphi里怎么用呢...

我在模块里自定义了一个函数:stradd()

可是在adoquery1.sql.add('select stradd(author) from book');
时提示stradd未定义...

这个问题有什么办法可以解决的吗? 非常感激!


(在A ......

小弟不会DELPHI,请大侠们帮个忙

这个是拦截按键消息并测试是否为ENTER键。
  begin
    case wParam of
      WM_KEYDOWN:
      fEatKeystroke := (p.vkCode = VK_RETURN);
  & ......

delphi导出后长数据显示不全

Delphi(Pascal) code:

procedure Tpaigon.N2Click(Sender: TObject);
var
j,col:integer;
filename:string;
MSExcel,xlsheet,xlBook:Variant; //ole ComObj
begin
IF DBGrid1.Fields[0].AsString=' ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号