Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can VFP work with SQL Server 2012?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01601532
Message ID:
01601543
Views:
95
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
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform