SQL中的字段是没空格的,如果将nvarchar(10)的数据(或空格)导到相同表结构的Access中,这后将这个表恢复到sql中,为什么会出现补长的空格(如果当时字段为空,恢复后却变成长度等于10的空格).我导到Access中时,定义的字段是char(因为Access中好像没有其它字符类型字段).注:以上的导数据全部用DataSet进行而不是写sql语句.请问如何才能做到没空格?或者access中的字符类型字段如何定义?

解决方案 »

  1.   

    默认为空‘’的话会补成空格,用NULL就不会了吧
      

  2.   

    我是用SQL语句在ACCESS中建表的,如何默认为空?另外,即使有一长度为2的字符,这样导来导去后,在长度为2的字符后面一样补8个空格.请指教...
      

  3.   

    if you use char datatype in Access, when the data lenth less then the column length,Access will use space to fill it.so if your data length is not same,please use varchar in Access.
      

  4.   

    我碰到过这样的情况,导进去之后再处理下吧 用Trim函数
      

  5.   

    我是用SQL语句在ACCESS中建表的,如何默认为空?另外,即使有一长度为2的字符,这样导来导去后,在长度为2的字符后面一样补8个空格.请指教...
    ACCESS中用SQL语句不能设置默认值!
      

  6.   

    you must read some document to understand what is the char and what is the varchar.you can use the varchar(N) datatype in create table sql statement in Access.
      

  7.   

    you must read some document to understand what is the char and what is the varchar.you can use the varchar(N) datatype in create table sql statement in Access to create table. the N is the column max size.eg.
    create table tablename (
             id counter not null,
             column1 varchar(100) not null
                           )