Data Type Mismatch

  • Thread starter Thread starter DH
  • Start date Start date
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
 
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];"
 
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


.
 
Back
Top