Z
zhm_good
Unregistered / Unconfirmed
GUEST, unregistred user!
我这个SQL是Tquery 自动生成的。有时我要修改其中的路径,怎么改??
SELECT Books.Bookno, Books.Bookname, Books."Position", Books.Memo, Books.Price, Type.Typestr
FROM "f:/图书管理系统/books.DB" Books
INNER JOIN "f:/图书管理系统/type.DB" Type
ON (Books.Type = Type.Typeno)
下面是我改的不知道错在哪时??? 300分求助,谢谢!
procedure Tmainfrm.N3Click(Sender: TObject);
const sqlstr1='from %s books';
const sqlstr2='INNER JOIN %s Type';
var
dataBaNa,ta1,ta2:string ;
begin
dataBaNa:=ExtractFilePath(Application.ExeName);
ta1:=dataBaNa+'books.db';
ta2:=dataBaNa+'type.db';
ShowMessage(ta1);
ShowMessage(ta2);
query1.close;
query1.SQL.Clear;
query1.SQL.add('SELECT Books.Bookno, Books.Bookname, Books."Position", Books.Memo, Books.Price, Type.Typestr');
query1.sql.add(format(sqlstr1,[ta1]));
query1.sql.add(format (sqlstr2,[ta2]));
query1.sql.add('ON (Books.Type = Type.Typeno)');
query1.ExecSQL;
query1.Active:=true;
end;
SELECT Books.Bookno, Books.Bookname, Books."Position", Books.Memo, Books.Price, Type.Typestr
FROM "f:/图书管理系统/books.DB" Books
INNER JOIN "f:/图书管理系统/type.DB" Type
ON (Books.Type = Type.Typeno)
下面是我改的不知道错在哪时??? 300分求助,谢谢!
procedure Tmainfrm.N3Click(Sender: TObject);
const sqlstr1='from %s books';
const sqlstr2='INNER JOIN %s Type';
var
dataBaNa,ta1,ta2:string ;
begin
dataBaNa:=ExtractFilePath(Application.ExeName);
ta1:=dataBaNa+'books.db';
ta2:=dataBaNa+'type.db';
ShowMessage(ta1);
ShowMessage(ta2);
query1.close;
query1.SQL.Clear;
query1.SQL.add('SELECT Books.Bookno, Books.Bookname, Books."Position", Books.Memo, Books.Price, Type.Typestr');
query1.sql.add(format(sqlstr1,[ta1]));
query1.sql.add(format (sqlstr2,[ta2]));
query1.sql.add('ON (Books.Type = Type.Typeno)');
query1.ExecSQL;
query1.Active:=true;
end;