I had a strange situation with a view in SQL 7, that I could use some input
on.
I had a very simple view -- select a, b, c from table1 where x=y and z=q.
Field a in table1 originally was varchar 70. A long time ago I changed it to
varchar 95.
I used this view as an ODBC linked table in an Access MDB. Recently, there
was one row which has a value in field a that was more than 70 characters
long. This caused an error when the view as opened in the MDB file: "string
data, right truncation (#0)"
I went to the view in SQL Server, and displayed the row fine. So I delete
the link to the view in Access, compacted the Access database, and recreated
the link. Same results. The row showed #Error in the linked view, and the
message box with the truncation error would come up.
I went into SQL Server, took the SQL from the view and created a new view. I
linked the new view in Access, and it worked fine. No error.
So it seems that, somehow, view was holding onto the old field length, even
though it was using the new field length when displayed. But when the view
was linked, it used the old field length.
Is there something I could have or should have done short of recreating the
view? Any idea why the view used the old field length when it was linked,
but used the new field length when it was opened directly?
Thanks!
Neil
on.
I had a very simple view -- select a, b, c from table1 where x=y and z=q.
Field a in table1 originally was varchar 70. A long time ago I changed it to
varchar 95.
I used this view as an ODBC linked table in an Access MDB. Recently, there
was one row which has a value in field a that was more than 70 characters
long. This caused an error when the view as opened in the MDB file: "string
data, right truncation (#0)"
I went to the view in SQL Server, and displayed the row fine. So I delete
the link to the view in Access, compacted the Access database, and recreated
the link. Same results. The row showed #Error in the linked view, and the
message box with the truncation error would come up.
I went into SQL Server, took the SQL from the view and created a new view. I
linked the new view in Access, and it worked fine. No error.
So it seems that, somehow, view was holding onto the old field length, even
though it was using the new field length when displayed. But when the view
was linked, it used the old field length.
Is there something I could have or should have done short of recreating the
view? Any idea why the view used the old field length when it was linked,
but used the new field length when it was opened directly?
Thanks!
Neil
Comment