Выполнение SQL-запроса к базе данных ADO
(defun ru-ado-exec-sql-to-connection
(connection_string user_name password SQL / connection_object Result)
;;; выполнение запросов к любой БД
;|
Проверка запросов к InterBase
(ru-ado-exec-sql-to-connection "Provider=MSDASQL.1;
Persist Security Info=False;
Extended Properties=DSN=Файлы dBASE;
DBQ=C:\DB\DBFDOS;DefaultDir=C:\DB\DBFDOS;DriverId=533;
MaxBufferSize=2048;PageTimeout=5;" "" "" "SELECT * FROM D1A06001")
|;
(if (setq connection_object
(ru-ado-connect-to-db
connection_string
user_name
password
) ;_ end of ru-ado-connect-to-db
) ;_ end of setq
(progn
(setq result (ru-ado-exec-sql connection_object SQL))
(ru-ado-disconnect-from-db connection_object)
) ;_ end of progn
) ;_ end of if
result
) ;_ end of defun