MS Access 运行时错误 3259 更改表上的无效字段数据类型 [英] MS Access run-time error 3259 invalid field data type on alter table
问题描述
完全重新安装我的计算机后,突然出现此错误:运行时错误 3259 更改表上的无效字段数据类型
运行此查询时:ALTER TABLE Invoices ALTER COLUMN ID COUNTER (1, 1)
在 MS Access 数据库上.
After re-installing my computer completely, suddenly I get this error:
Run-time error 3259 invalid field data type on alter table
when running this query:
ALTER TABLE Invoices ALTER COLUMN ID COUNTER (1, 1)
on a MS Access database.
数据类型没有变化,实际上除了重新安装之外没有任何变化..
The data type didn't change, actually nothing changed except for the re-install..
字段 ID 是一个长整型字段,该字段被设置为针对表中保存的每个发票自动递增.由于数据仅临时驻留在此表中,因此我在每批之后重置自动增量.我认为这可能与不同版本中缺少或更改的引用有关..但我似乎无法弄清楚是哪一个或为什么..
The field ID is a Long Integer field that is set to auto increment for every Invoice that the table holds. Since data resides in this table only temporarily I reset the auto increment after every batch. I think it may have something to do with references missing or changed in different versions.. But I can't seem to figure out which one or why..
我的查询需要更明确吗?有没有人经历过这种情况?
Do I need to be more explicit in my query? Anyone ever experience this before?
推荐答案
我遇到了同样的问题.我正在检查 如何更改链接表的数据定义"当我想到我可以尝试将字段数据类型更改为 NUMBER
并查看该代码是否有效时.
I was having the same problem. I was checking "Hoew to alter the data definition of a linked table" when it occurred to me that I could try changing the field datatype to NUMBER
and see if that code worked.
所以我把代码改成:
ALTER TABLE XXXXX ALTER COLUMN ID NUMBER
运行代码没有问题!检查表设计,字段数据类型从自动编号更改为数字.
Run the code with no problems! Checked the table design, and the field datatype had changed from Autonumber to Number.
所以,我决定再次尝试原始代码:
So, I decided to try the original code again:
ALTER TABLE XXXX ALTER COLUMN ID COUNTER (1,1)
而且……它奏效了!!!O.O
and... IT WORKED!!! O.O
我不明白为什么......但它有效......
I don't understand why... but it worked...
尝试通过代码将数据类型更改为NUMBER
,运行它,然后将其改回COUNTER(1,1)
,看看是否修复了错误,像我一样...
Try changing the datatype to NUMBER
via code, run it, then change it back to COUNTER(1,1)
, and see if you got the error fixed, like mine did...
这篇关于MS Access 运行时错误 3259 更改表上的无效字段数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!