Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FoxPro to MS SQL Server text problems
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
FoxPro to MS SQL Server text problems
Divers
Thread ID:
00004399
Message ID:
00004399
Vues:
94
Hello to all.

I'm an experienced Windows programmer (VFP, Delphi, MSVC, etc.) working for a small company. We are developing a client/server internet database application, and are using Microsoft's SQL Server 6.0 as back-end, and Microsoft FoxPro 3.0 for our data-entry front-end. I have one problem I ran into a couple of weeks back and haven't figured out yet until now.

We have a certain field called 'description' in one of our SQL Server tables, which is of the SQL Server datatype 'text'. The text datatype was meant to hold arbitrarily sized textual data in increments of 2K. This is opposed to the SQL Server 'varchar' data type which holds arbitrarily sized character data up to 255 characters in length only.

In our FoxPro data-entry front-end, I've built a screen/form to enable the user to browse through, add and edit records to this remote table. For the 'description' field, I'm using a memo control (actually, a multi-line edit control).

The problem occurs when our users start editing the remote data through this form. For certain records (as far as I can tell, those whose 'description' fields contain less than 255 characters), there are no problems and the whole thing works just great. However, for records where the description fields contain more that 255 characters (not sure about this, just a hunch), an ODBC connectivity error sometimes occurs:

[Microsoft][ODBC SQL Server Driver][SQL Server] Implicit conversion from datatype 'text' to 'varchar' is not alowed. Use the CONVERT function to run the query.

First of al, I'm not using the 'varchar' datatype, I'm using 'text'. So no conversion should occur, should there? Secondly, how come this only occurs when the 'description' field contains more than the 255 character maximum for 'varchar' types in the first place? Finally, assuming I need to use CONVERT, how do I place that in the query? The query is a 'child' query so this might pose even more problems.

Hoping for the best anyway.
alistair israel
Distressed DBA, Sleepy SysAd, Weary WebMaster (aka Senior Software Engineer)
aisrael@poboxes.com
Makati City, Philippines
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform