Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server 2012 - ODBC drivers and varchars not working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01609024
Message ID:
01609035
Vues:
66
Hi Jeff,

I did test {SQL Server} and {SQL Server Native Client 10.0} + SET VARCHARMAPPING ON + MSSQL 2008 and VFP create cursor with CHAR fields always.

But you can use:
=CURSORSETPROP("MapVarchar",.T.,0)

... VARCHAR fields on DB server are maps to VARCHAR in VFP.

MartinaJ

>Thanks Martina, but using the CursorAdapter is pretty much a massive rewrite of our existing data classes and that is out of the question.
>
>I need to use SPT with regular sqlexecute(lnConn,'select * from foo') kinda stuff. Same with inserts.
>
>Why have I seen this work with SQL Server 2008, but it doesn't work with SQL 2012?
>
>>Hi Jeff,
>>
>>set varcharmapping on is only for VFP SELECT - SQL. For ODBC driver you must use CursorAdapter with MapVarchar=.T.
>>
>>MartinaJ
>>
>>>I'm sorry to bother everyone again about this subject, but I'm stuck...
>>>
>>>We have a MS SQL Server 2012 and VFP9. We want to use varchars in SQL Server and have them come down to VFP9 as varchars, but the best I can do is they come down as character and not varchar.
>>>
>>>I'm pretty sure I've done this successfully at my last job where we only had MSSQL 2008.
>>>
>>>Here are my various connection string efforts:
>>>
>>>?sqlstringconnect("Driver={SQL Server};Server=.;Database=jeff;Trusted_Connection=yes;")
>>>?sqlstringconnect("Driver={SQL Server Native Client 10.0};Server=.;Database=jeff;Trusted_Connection=yes;")
>>>?sqlstringconnect("Driver={SQL Server Native Client 11.0};Server=.;Database=jeff;Trusted_Connection=yes;")
>>>
>>>And I select * from a table in my db that has one Id field and one varchar field. But, as I said before, they are fat padded characters in VFP9. I've also set varcharmapping on.
>>>
>>>Help!
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform