View Full Version : Connecting VFP 6 to SQL Server 2000
Dean Lesner
04-11-01, 13:31
| I'm running under Windows NT 4.0 with VFP 6 and SQL Server 2000 installed on the same machine, attempting to connect to the Northwind database. (This is my first attempt at connecting to any type of SQL Server atabase. )SQLConnect() returns a value of 2 and SQLExec() returns -1. I don't think there are any syntax errors, because my code is copied from a training video. Does it sound like I need to update my ODBC drivers, or is there another step involved?
TIA
Dean Lesner |
Wolfgang Hölsken
04-11-01, 14:56
Hi,
try to find out why -1 was returned:
? aerror(aErrorArray) ? aErrorArray(1) ? aErrorArray(2) ? aErrorArray(3) ...
Wolfgang
PS:
I tried to install client and server on the same machine too. Performance was lousy. The server got hold of all the memory it could get. You probably should install the server on some other computer on your network, when you want decent performance.
| SQLEXEC returns -1 when a SQL call fails. you use the SQL of the host in a SQLEXEC. syntax after your SQLEXEC, do this:
aerror(myerr)
and check the myerr array elements 4 and 5 for SQL 2000 errors VFP/ODBC return host errors this way.......... |
DLesner123
04-12-01, 04:25
Thanks for the feedback, everyone. Using Wolfgang Holsken's aerror() suggestion, I was able to determine that the drivers were okay, and my code was at faultt. (I had incorrectly typed "Select * from Northwind.Customers" instead of "Select * from Customers")
vBulletin v3.5.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.