Query1.Close;
Query1.Sql.Clear;
Query1.Sql.Text:='create table yourtablename(id integer)';
Query1.ExecSql;
Query1.Sql.Clear;
Query1.Sql.Text:='create table yourtablename(id integer)';
Query1.ExecSql;
解决方案 »
- DELPHI求注解!
- delphi 哪些变量或者资源 需要手动分配内存和释放资源?哪些是系统自动释放资源啊?
- 简单的报表预览问题
- 自定义函数总提示警告
- 怎样让tlistview,ttreeview,tlistbox,tcombobox的某一个选项变背景和文字变色?
- 触发器到底是什么东西呀?怎样使用
- 急救,paradox 表出错:提示:Corrupt table/index header
- 请tonylk兄弟近来拿分,给错那个贴子给分的时候填错了:)
- 有没有什么好的方法可以随即在0--10产生4个不同的数字
- 征求解决方案!
- 如何用socket api写UDP协议通信的程序。。。
- 版主,您好!对贵站提了不少好建议,能否给加10000分!近来忙穷了!^_^
不用query 也可
开始菜单delphi-> help->bde->locate sql
对本地表的sql说的比较请促
Last_Name CHAR(20),
First_Name CHAR(15),
Salary NUMERIC(10,2),
Dept_No SMALLINT,
PRIMARY KEY (Last_Name, First_Name))An alternate syntax for creating a primary key constraint is using the CONSTRAINT keyword. While Paradox primary indexes do not have names, an arbitrary name needs to be provided to satisfy the CONSTRAINT keyword need for a token name.CREATE TABLE "employee.db"(
Last_Name CHAR(20),
First_Name CHAR(15),
Salary NUMERIC(10,2),
Dept_No SMALLINT,
CONSTRAINT z PRIMARY KEY (Last_Name, First_Name))Indicate whether the table is a Paradox or dBASE table by specifying the file extension when naming the table:".DB" for Paradox tables
".DBF" for dBASE tablesIf you omit the file extension for a local table name, the table created is the table type specified in the Default Driver setting in the System INIT page of the BDE Administrator utility. When specifying a file extension, the table name reference for CREATE TABLE must be enclosed in quotation s.Column definitions based on domains are not supported. Primary keys are the only form of constraint that can be defined with CREATE TABLE.Note To create a table with columns that have non-alphanumeric characters or spaces in the column name, you must enclose the column name in quotation s and prefix the quoted column name with the table name in quotes (if the filename extension is included) or just the table name. Any one of the three variations below are acceptable.CREATE TABLE "abc.db"(
ID CHAR(3),
"ABC.db"."Funny Name" CHAR(10))CREATE TABLE abc(
ID CHAR(3),
ABC."Funny Name" CHAR(10))CREATE TABLE "abc.db"(
ID CHAR(3),
ABC."Funny Name" CHAR(10))
with query1 do begin
sql.Clear;
sql.Add('create table "mytable1.db"(xuehao:integer,xingming:string)');
execsql;
end ;
首先表名可以不用加"",我从来就没加。
第二不用加 :号
第三应该没有string型吧?改为varchar(20)之类!
你是什么数据库?
create table TableStu (Index integer,Name varchar(20));
//我估计主要试你的类型出错。这些类型鱼你数据库有关!
qry.Sql.Add('create table "mytable1.db"(xuehao integer,xingming char(10))');
是正确的
(xuehao:integer,xingming:string)');
不合sql 规范 那是delphi 的语法
sql 是由数据库区执行的
如果你用bde
先用dababase 连接到你的数据库(source.mdb);
query1.batabasename=dababase 的batabasename
with query1 do
begin
close;
sql.Clear;
sql.Add('create table 表1(xuehao integer,xingming char(10))');
execsql;
end ;
如果用ado 也差不多关键看类型要access支持
qq 16211043