Results 1 to 4 of 4
  1. #1
    Dean Lesner Guest

    Answered: Connecting VFP 6 to SQL Server 2000

    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

  2. Best Answer
    Posted by DLesner123

    "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")"


  3. #2
    Wolfgang Hölsken Guest
    Hi,

    try to find out why -1 was returned:
    Code:
    ? 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.

  4. #3
    gwalkey Guest
    SQLEXEC returns -1 when a SQL call fails. you use the SQL of the host in a SQLEXEC. syntax after your SQLEXEC, do this:
    Code:
    aerror(myerr)
    and check the myerr array elements 4 and 5 for SQL 2000 errors VFP/ODBC return host errors this way..........

  5. #4
    DLesner123 Guest
    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")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •