Hi John,
of course there are ODBC drivers to MSSQL. You can create a DSN to connect to MS SQL Server, too.
I'd rather not use a DSN though, simply use a connection string. That'll be usable for all three types of remote access, too:
1. Remote Views - where the sql connection string is applied to a connection object in a DBC
2. SQL passthrough (what that tutorial shows) - where you have SQLStringConnect
and
3. Cursoradapters, where also SQLStringConnect is used and the result handle is stored into the cursoradapter DataSource, while DataSourceType is ODBC.
You get the ODBC driver installed together with SQL Server Management Studio:
Not 1000% sure, but the management studio doesn't work without being able to connect and it does so via ODBC.
You also find specific ODBC drivers standalone installations:
And then see
It starts out as simple as
Code:
h=SQLStringConnect(connectionstring)
SQLExec(h,"SELECT * FROM table","crsVFPResult")
SQLDisconnect(h)
But it pays to look into cursoradapters in the VFP help. Help chapter "Data Access Management Using CursorAdapters" is a starting point.
And there's a lot to learn before you deep dive into writing your own SQL only based SQL life cycle of inserting, reading, updating and deleting data, cursoradapters and remote views easily allow you to get an updatable cursor, which means you act on the result cursor, you eventuially do a TABLEUPDATE() and the necessary SQL insert/update/delete statements are generated and executed by TABLEUPDATE().
Bye, Olaf.
Olaf Doschke Software Engineering