CLEAR SET SAFETY OFF SET TALK OFF CLOSE DATABASES CLOSE TABLES #DEFINE MB_OKBUTTON 0 #DEFINE MB_STOPSIGNICON 16 LOCAL hConn *Replace <servername> with the sQL servername *Replace <databasename> with the SQL database lnHan = SQLSTRINGCONNECT("Driver=SQL Server;Server=<servername>;Database=<databasename>;Trusted_Connection=No") IF (lnHan < 0) LOCAL ARRAY laError[ 1] AERROR(laError) MESSAGEBOX( ; laError[ 2], ; MB_OKBUTTON + MB_STOPSIGNICON, ; "Error " + TRANSFORM(laError[ 5])) ELSE WAIT WINDOW "SUccessfully connected!" NOWAIT ENDIF ? lnHan lnClose=SQLDISCONNECT(lnHan) ?lnClose