Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2006
    Posts
    1

    Unanswered: Linked SQL tables issue

    I'm developing an Access 2003 database with a SQL 2000 back-end database. I've linked these tables through ODBC. When I enter data into a text field in these tables, the text is padded with spaces to the length of the field definition in SQL. For example, the value 'ABC' in a Char(10) field would result in 'ABC '. I've tried other character field types in SQL, but the only one that doesn't do this is the Text type which Access treats as a Memo field and it cannot be searched on. Is there any option or setting that I can change to avoid the extra spaces in these fields? Thanks.

    Paul

  2. #2
    Join Date
    Jul 2005
    Posts
    50
    You can still do a search by utilizing the Trim() function in your search query.

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    As I posted on another site where you posted the same question, Varchar(10).
    Paul

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    spaces

    Pbaldy is correct! Use varchar(10) or nvarchar(10) (unicode). This automatically trims the trailing spaces.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •