You receive a "DataType Property for Field 'Field_Name' is Invalid" error message when you try to access remote views of SQL Server 7.0 tables in Visual FoxPro (234070)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q234070 SYMPTOMS When you try to use a remote view of Microsoft SQL Server 7.0
tables that contains Unicode fields (NCHAR, NVARCHAR, and NTEXT) defined with a
length greater than 254 characters, the following error message appears in Microsoft Visual FoxPro:
DataType Property for Field 'Field_Name' is Invalid
RESOLUTION There are two workarounds for this issue.
- Use the DBSETPROP() function to set the DataType property
to a valid value. The following code illustrates:
=DBSETPROP('MyView.UniCodeField','Field','DataType','C(254)') NOTE: Attempting to set the DataType Property to "M" results in the
following error message when attempting to use the remote view:
Type conversion required by the DataType property for
field "name" is invalid - Explicitly cast the Unicode fields, defined with a length
greater than 254 characters, when creating the remote view:
CREATE SQL VIEW view2 REMOTE CONNECTION uniconn ;
AS SELECT cast(nchar_fld AS TEXT) AS nchar_fld, ;
unitest.char_fld, cast(nvarchar_fld AS TEXT) AS nvarchar_fld, ;
unitest.varchar_fld, cast(ntext_fld AS TEXT) AS ntext_fld, ;
unitest.text_fld ;
FROM dbo.unitest unitest
Modification Type: | Major | Last Reviewed: | 3/19/2005 |
---|
Keywords: | kbDatabase kberrmsg kbprb KB234070 kbAudDeveloper |
---|
|