大家好,我刚刚开始用delphi,有很多不懂得,望大家多多帮助。谢谢了先!!在TQuery中为什么在设置SQL属性,并且加参数以后,requestLive属性就不能设为true了?否则就会提示“找不到对象”!!比如:
query1.sql.clear;
query1.sql.add('select * from table where id=:id');
query1.ParamByName('id').AsInteger := 1;这时如果
query1.requestLive := true;
query1.open时就会出错??!!
而如果
query1.requestLive := false;
query1.open就没问题。
这是为什么啊???
query1.sql.clear;
query1.sql.add('select * from table where id=:id');
query1.ParamByName('id').AsInteger := 1;这时如果
query1.requestLive := true;
query1.open时就会出错??!!
而如果
query1.requestLive := false;
query1.open就没问题。
这是为什么啊???
解决方案 »
- 以饼图显示一个班级由三个年龄段的同学组成,应当怎么设置TChar?
- Report Machine报表控件中导出PDF组件问题
- 用dspack开发视频聊天程序怎么配合xvid压缩视频流
- 有没有类似于DBGridEh那样的控件,但数据不是来源于数据库,而是来源于数组或者StringList。
- 各位大侠们,不知道大家那位有PDF的API手册,帮帮小弟我吧.给我一份啊.
- 谁有ERWIN 4.0的注册码或注册机?我找一个下午,都没找到。
- 字符串--》字符--》ASCII??。。。。。
- 用ole操作如何使EXCEL不显示状态栏和编辑栏
- 关于ShellExecute
- 最顶端的模态窗口???
- 窗口激活问题
- 使用ListView显示图片的效果问题!
procedure TForm1.Button1Click(Sender: TObject);
begin
query1.SQL.Text:='select * from employee where empno=:id';
query1.ParamByName('id').AsInteger:=20;
query1.Open;
end;
而且requestlive是否是true或者false都没问题阿!!
找不到对象,你看看你的表里面有没有id这个字段阿!!
我使用delphi 7进行数据库操作阿!!
也就是说数据库里TABLE和ID是大写,也必须在SQL里写成大写才行!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
功 能: 返回当前图形位置的x坐标
用 法: int far getx(void);
程序例: #include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h> int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
char msg[80]; /* initialize graphics and local variables */
initgraph(&gdriver, &gmode, ""); /* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
} /* move to the screen center point */
moveto(getmaxx() / 2, getmaxy() / 2); /* create a message string */
sprintf(msg, "<-(%d, %d) is the here.", getx(), gety()); /* display the message */
outtext(msg); /* clean up */
getch();
closegraph();
return 0;
}
函数名: gety
功 能: 返回当前图形位置的y坐标
用 法: int far gety(void);
程序例: #include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h> int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
char msg[80]; /* initialize graphics and local variables */
initgraph(&gdriver, &gmode, ""); /* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
} /* move to the screen center point */
moveto(getmaxx() / 2, getmaxy() / 2); /* create a message string */
sprintf(msg, "<-(%d, %d) is the here.", getx(), gety()); /* display the message */
outtext(msg); /* clean up */
getch();
closegraph();
return 0;
}