>sqlconnstring="DRIVER=SQL Server;SERVER=(local);database=Northwind;uid=sa"
>
>DRIVER=SQL Server;SERVER=DSERVER3;database=Euro_Mig_subset;uid=sa;pwd=>>>BTW, It's a security hole to have sa account w/o password.
>>>>HIDDEN PROCEDURE _SQLConnect >>>> >>>>LOCAL bRetVal, iErrNo, sErrMsg, aErrInfo[1] >>>>bRetVal = TRUE >>>> >>>>WITH This >>>> >>>> ** Suppress ODBC error dialog >>>> SQLSETPROP(0, "DispWarnings", .F.) >>>> >>>> ** Suppres login dialog >>>> SQLSETPROP(0, "DispLogin", 3) >>>> >>>> ** Attempt to connect to the database >>>> ._iConnHandle = SQLSTRINGCONNECT(._sSqlConnStr) >>>> >>>> ** If not connected... >>>> IF ._iConnHandle < 0 >>>> >>>> ** Get the error information >>>> AERROR(aErrInfo) >>>> iErrNo = aErrInfo[1] >>>> sErrMsg = aErrInfo[2] >>>> >>>> ** Format the error message >>>> .sMessage = "Unable to connect to SQL database" + CHR(13)+; >>>> "Error " + TRANSFORM(iErrNo) + CHR(13)+; >>>> sErrMsg >>>> >>>> ** Turn on the class's error flag >>>> .bErrorOccured = TRUE >>>> >>>> ** Set the function return value to false >>>> bRetVal = FALSE >>>> >>>> ENDIF >>>> >>>>ENDWITH >>>> >>>>RETURN bRetVal >>>> >>>>ENDPROC >>>> >>>>