Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can VFP work with SQL Server 2012?
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 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01601532
Message ID:
01601573
Vues:
78
>Just gave this a try on my local machine here. I can verify that with the SQL Native client installed and your connection string it doesn't work. I don't get chars but I get no data for the varchar(max) fields - empty strings.
>
>However if I use the old Sql Server drive (V6), then it works just fine:
>
>
>loSql = CREATEOBJECT("wwSql")
>? loSql.Connect("driver={sql server};database=WebMonitor;integrated security=true")  
>? loSql.Execute("select * from WebMonitorSites")
>BROWSE
>
>
>I use wwSql with this but underneath this delegates to SqlStringConnect()/SqlExecute().
>
>I remember hearing about other issues with the new drivers - basically while the new driver supports new features of SQL Server a lot of those features have no matching interfaces in the old ODBC interfaces that VFP actually uses. So I think there's very little benefit to actually using the new driver. FWIW, the old V6 Sql Server driver on my machine is actually newer (dated 2013 vs. 2012 for the V11 driver) so it looks that Microsoft is at least keeping the old version up to date with bug and security fixes. Given that MS has dropped OleDb in favor of ODBC that's a good sign.
>
>IAC it looks like varchar(max) works with the old driver. Hopefully there's not something else that depends on the new driver to work.
>
>+++ Rick ---
>
>>I'm using this as a connection string to a SQL 2012 Server:
>>
>>?sqlstringconnect("Driver={SQL Server Native Client 11.0};Server=dev;Database=foobar;Trusted_Connection=yes;")
>>
>>Unfortunately, my SQL 2012 table has varchars and they're all coming down to VFP9 as plain old chars and the varchar(MAX) is coming down as Char(0).
>>
>>At least the Date is coming down as a VFP date.
>>
>>Is there a better ODBC driver to SQL?
>>Am I in trouble for using varchar(MAX)?
>>Am I in trouble for using SQL 2012?
>>
>>TIA

IIRC - the problem with the old odbc driver is that date fields don't work.

Pick your poison:
Old odbc driver works with varchar(max) but not date
New odbc driver works with date but not varchar(max), you have to use Text instead
Brandon Harker
Sebae Data Solutions
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform