Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VARCHAR problem with SQL Server 2003
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01504092
Message ID:
01504106
Vues:
70
>>>>>Have a table filled with comments. Use varchar for the comments. Something changed in our testing environment, this has been working fine for at least a year. Now a SQL Select to this table the field returned back in VFP in the cursor returns an empty text field. If I copy the SQL select command out of the code, run it at the command prompt I get a memo field with the text that is there which WAS the behavoir before.
>>>>>
>>>>>Any ideas what to look for.
>>>>
>>>>I assume that you're talking about SQL 2005 and varchar(MAX). You'll get correct result in VFP for varchar(MAX) only with SQL 2000 ODBC driver. With SQL Server Native client empty values will be returned for varchar(MAX). It's VFP bug that is not going to be fixed.
>>>
>>>I understand the not being fixed part been doing VFP exclusively since 2004.
>>>
>>>I don't understand the was working now is not part and is fine in production part, as well as the command prompt part. Command prompt part =s the following steps
>>>
>>>1) Start a VFP session
>>>2) run the app see the problem in Debug using browse immediately after the cursor is returned.
>>>3) kill the debugging process (remain in same vfp session)
>>>4) at the command prompt run a prg that creates a SQL Server Connection exactly as the application does
>>>5) run the SQL Select with success.
>>>
>>>Its all happening on 2003 servers with SQL 2003 NOT 2005.
>>>
>>>Not so sure your response on this bug fits here. Thanks though good to know
>>
>>Ron,
>>
>>There is NO SQL Server 2003. You're mistaken. Please run
>>
>>select @@Version, SERVERPROPERTY('Edition') AS Edition,
>>	SERVERPROPERTY('ProductVersion') AS ProductVersion,
>>	SERVERPROPERTY('ProductLevel') AS ProductLevel
>>
>>and post the results here.
>>
>>Also, we're using DSN for connection and sqlexec and I don't have problems with varchar(max)
>
>You are right on the SQL version, my mistake. But the other questions still remain. It is a connection problem somehow.
>Connection string code from my command prompt prg (mimics app connect code which is a little different due to being inside of a framework)
>
>cSQLDriver = 'SQL Server'
>cSQLServer = 'poormsdev1'
>cSQLUID = ''
>cSQLPWD = ' '
>cSQLDatabase = 'MCS_Test'
>
>cConnectString = 'Driver=' + ALLTRIM(cSQLDriver)
>cConnectString = cConnectString + ';' + 'Server=' + ALLTRIM(cSQLServer)
>cConnectString = cConnectString + ';' + 'UID=' + ALLTRIM(cSQLUID)
>cConnectString = cConnectString + ';' + 'PWD=' + ALLTRIM(cSQLPWD)
>cConnectString = cConnectString + ';' + 'Database=' + ALLTRIM(cSQLDatabase)
>cConnectString = cConnectString + ';' + 'Trusted_Connection=Yes'
>
>
>*----------------------------------------------
>*-- August 7, 2002 Ron Darling
>*-- Disable errors and login.
>*----------------------------------------------
>SQLSETPROP(0, 'DispWarnings', .T.)
>SQLSETPROP(0, 'DispLogin', 1)
>
>
>nSQLHandle = SQLSTRINGCONNECT(cConnectString)

Try all variations from http://connectionstrings.com/sql-server-2005#p109

Also, why do you need Trusted_Connection = Yes if you supply password and userid ?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform