ACCESS 2007 的插入问题
我用的是access 2007 我有一个如下所示的 sql 命令
string sql = "INSERT INTO t_person_info(name,surname,bdate,bplace,branch,lang) VALUES('JOE','ADAMS','12/12/2000','London','ENGNR','ENG')";
conn.Open();
command.CommandText = sql;
command.ExecuteNonQuery();
conn.Close();
,但它给出了一个错误该字段太小,无法接受您尝试添加的数据量。尝试插入或粘贴较少的数据
那么问题是什么,
以及如何解决呢??
I use access 2007
and i have a sql command like below
string sql = "INSERT INTO t_person_info(name,surname,bdate,bplace,branch,lang) VALUES('JOE','ADAMS','12/12/2000','London','ENGNR','ENG')";
conn.Open();
command.CommandText = sql;
command.ExecuteNonQuery();
conn.Close();
But it gives an error The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data
So what is the problem,
And how solve it??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个字段都有给定的长度或大小。对于文本字段,它是可以存储的字符数。对于数字类型,它是组成字段的字节数,它限制了该字段中可以存储的数字范围。
例如,您要在分支字段中插入 4 个字符,但其长度可能仅为 3。检查您的表和每个字段的长度/大小,以确保它们足够大以容纳您要存储的数据。
Each field has a given length or size. For text fields, it's the number of characters that can be stored. For numeric types, it's the number of bytes that make up the field, which constrains the range of numbers that can be stored in that field.
For example, you are inserting 4 characters in to branch field, yet its length might only be 3. Check your table and the length/size of each field to be sure they are large enough to accomodate the data you want to store.