HELP: Why EXcute() of CDaodatabase does not work with "CREATE TABLE" sql
Using CDaodatabase and CDaoRecordset to work with Sql2000 personal.
sql = _T("SELECT * INTO YOU FROM MY WHERE 1=2");
db.Execute(sql);
Excute() is doing well with copying a table, but
sql = _T("CREATE TABLE THEY (DATES Long NOT NULL PRIMARY KEY,CROSS Long NULL);");
db.Execute(sql);
Excute( ) does not work!!! it does not work with "CREATE TABLE" sql!!!!
Why??
Re: HELP: Why EXcute() of CDaodatabase does not work with "CREATE TABLE" sql
Quote:
Originally Posted by
genliu777
Using CDaodatabase and CDaoRecordset to work with Sql2000 personal.
Code:
sql = _T("SELECT * INTO YOU FROM MY WHERE 1=2");
db.Execute(sql);
Excute() is doing well with copying a table, but
How can it copy anything with such a condition: "WHERE 1=2"? :confused:
Quote:
Originally Posted by
genliu777
Code:
sql = _T("CREATE TABLE THEY (DATES Long NOT NULL PRIMARY KEY,CROSS Long NULL);");
db.Execute(sql);
Excute( ) does not work!!! it does not work with "CREATE TABLE" sql!!!!
Why??
Define "does not work". What error do you get?
Besides, i don't see any exception handling in your code snippet. Don't you use it? :confused:
Re: HELP: Why EXcute() of CDaodatabase does not work with "CREATE TABLE" sql
"WHERE 1=2" means copying table structure without any data or record! it works well with ACCESS.
"does not work" according to the create sql words, it should create a table in the database! but no new table is created.
Re: HELP: Why EXcute() of CDaodatabase does not work with "CREATE TABLE" sql
Quote:
Originally Posted by
genliu777
"WHERE 1=2" means copying table structure without any data or record! it works well with ACCESS.
Ok, now it is clear.
Quote:
Originally Posted by
genliu777
"does not work" according to the create sql words, it should create a table in the database! but no new table is created.
Well, then again:
Quote:
Originally Posted by
VictorN
...
Besides, i don't see any exception handling in your code snippet. Don't you use it? :confused: