>I am connecting to a paradox database using an ODBC system DSN.
>
>I have a DBC connection recorded and within the VFP IDE I can successfully extract data.
>
>However using the same DBC connection in a compiled program returns 'error 1466 Connection is invalid' on executing sqlconnect().
>
>Anyone any idea on what I am missing.
The error is Connection
handle is invalid.
That means that you are not connected to your DB.
You ALWAYS should check what happens with every function that starts with SQL
lnConnection = SQLCONNECT(YourStoredConnection)
IF lnConnection < 0
AERROR(laError)
MessageBox("Can not connect to server. Reason: "+laError[1,2])
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.