Data Type Mismatch

D

DH

Hi,
I'm trying to drop a field number in my table:
strSQL = 'ALTER TABLE EMP DROP COLUMN 1';
db.Excecure (stSQL)
I got data type mismatch error message. How could I fix
this prolem? Thank you very much!
DH
 
A

Allen Browne

Use the name of the field instead of the number, e.g.:
strSql = "ALTER TABLE [MyTable] DROP COLUMN [DeleteMe];"

If the field really is named "1", then enclose its name in square brackets
strSql = "ALTER TABLE [MyTable] DROP COLUMN [1];"
 
D

DH

It works! Thanks a lot!
DH

-----Original Message-----
Use the name of the field instead of the number, e.g.:
strSql = "ALTER TABLE [MyTable] DROP COLUMN [DeleteMe];"

If the field really is named "1", then enclose its name in square brackets
strSql = "ALTER TABLE [MyTable] DROP COLUMN [1];"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hi,
I'm trying to drop a field number in my table:
strSQL = 'ALTER TABLE EMP DROP COLUMN 1';
db.Excecure (stSQL)
I got data type mismatch error message. How could I fix
this prolem? Thank you very much!
DH


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top