各位,请帮帮我(100分)

  • 主题发起人 主题发起人 davidye
  • 开始时间 开始时间
D

davidye

Unregistered / Unconfirmed
GUEST, unregistred user!
我运行一个程序时出现如下错误,请各位大侠指正。谢谢!
错误:“invalid use of keyword token:a,book_info line number:1.’
原码如下:
sql.Add('select b.图书编号,b.书名,b.作者,b.出版社,b.类别,a.借出时间'+
'from borrow_info a,book_info b'+
'where a.学生证号='''+userpwd+''' and a.图书编号=b.图书编号');
 
如果你使用多行,注意习惯在下一行前面加上空格
sql.Add('select b.图书编号,b.书名,b.作者,b.出版社,b.类别,a.借出时间'+
' from borrow_info a,book_info b'+ //注意在前面加上空格
' where a.学生证号='''+userpwd+''' and a.图书编号=b.图书编号'); //注意在前面加上空格
 
'select b.图书编号,b.书名,b.作者,b.出版社,b.类别,a.借出时间'+
'from borrow_info a,book_info b'+
'where (a.学生证号='+''''+userpwd+''''+') and (a.图书编号=b.图书编号)'
 
sql.Add('select b.图书编号,b.书名,b.作者,b.出版社,b.类别,a.借出时间'+
'from borrow_info a,book_info b'+//from前没有空格,不知是否是原因
'where a.学生证号='''+userpwd+''' and a.图书编号=b.图书编号');
是否改为:
sql.Add('select b.图书编号,b.书名,b.作者,b.出版社,b.类别,a.借出时间'+
' from borrow_info a inner join book_info b on a.图书编号=b.图书编号 where a.学生证号='''+userpwd+'''');
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部