Conectarse a SQL Server

Puedes hacerlo con el Driver que te vende Windev o con OLE DB. Aquí te muestro la forma de hacerlo por OLE DB

MiConexion is Connection

// Completa valores generales de la conexión
MiConexion..Server = "MiPC\SQLEXPRESS"
MiConexion..Database = "BasedeDatos1"
MiConexion..Access = hOReadWrite
MiConexion..Provider = hOledbSQLServer
MiConexion..CursorOptions = hClientCursor + hStaticCursor + hReadOnlyCursor

// Conexión con USR y PASS
IF True THEN
       MiConexion..User        = "sa"
       MiConexion..Password    = "xxxxx"
       MiConexion..ExtendedInfo = ""

// Conexión Windows Authentication
ELSE 
       MiConexion..User        = ""
       MiConexion..Password    = ""
       MiConexion..ExtendedInfo = "Trusted_Connection=YES"
END

IF NOT HOpenConnection(MiConexion) THEN
      Error(HErrorInfo())
      EndProgram()
END