L
L.Q
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠,请赐教,在这先谢了,有分送:
用TADOQuery控件把数据库的数据传递给DBGrid,
表结构:
表1:表名:base_country,字段:id,coun_no,name_chi,name_eng,continentid,remark
表2:表名:base_continent,字段:id,cont_no,name_chi,name_eng,remark.
语法如:
SELECT a.coun_no,a.name_chi,a.name_eng,b.name_chi as bname,a.remark
FROM base_country a
INNER JOIN base_continent b ON (b.id = a.continentid)
DBGrid显示的字段为:
Coun_no,name_chi,name_eng,bname,remark.
其中bname为表2的name_chi.
接着往DBGrid中输入多条数据后保存却无法送到数据,如何同时把bname的值转换成表2的id提交结表1的continentid
软件结构:C/S,Delphi6.0+ADO+SQL server7.0;
用TADOQuery控件把数据库的数据传递给DBGrid,
表结构:
表1:表名:base_country,字段:id,coun_no,name_chi,name_eng,continentid,remark
表2:表名:base_continent,字段:id,cont_no,name_chi,name_eng,remark.
语法如:
SELECT a.coun_no,a.name_chi,a.name_eng,b.name_chi as bname,a.remark
FROM base_country a
INNER JOIN base_continent b ON (b.id = a.continentid)
DBGrid显示的字段为:
Coun_no,name_chi,name_eng,bname,remark.
其中bname为表2的name_chi.
接着往DBGrid中输入多条数据后保存却无法送到数据,如何同时把bname的值转换成表2的id提交结表1的continentid
软件结构:C/S,Delphi6.0+ADO+SQL server7.0;