ODBC on Access db

Started by DavMin, December 16, 2011, 08:57:52 AM

Previous topic - Next topic

DavMin

(set 'sourcedir (append (env "USERPROFILE") "\Desktop\Newlisp Access"))
(load (append sourcedir "\odbc.lsp"))

(if (not (ODBC:connect (append sourcedir "\fake.accdb") "" "")) (println "not connected..")
(println "connected.."))


Output:


"C:\Documents and Settings\dm\Desktop\Newlisp Access" (lambda ()   (if (not (ODBC:connect "test-db" "" ""))    (exit))   (println "connected ...")   (ODBC:query "insert into fruits values ('apples', 11)")   (ODBC:query "insert into fruits values ('oranges', 22)")   (ODBC:query "insert into fruits values ('bananas', 33)")   (println "inserted 3 records")   (ODBC:query "select * from fruits")   (println "performed a query")   (println (ODBC:num-cols) " columns in result set")   (println "fetching rows ...")   (while (set 'row (ODBC:fetch-row))    (set 'row (map trim row))    (println row))   (println)   (ODBC:query "delete from fruits")   (println "rows deleted: " (ODBC:affected-rows))   (println "nclosing database")   (ODBC:close-db)) Could not connect not connected.. "not connected.."

What have I done wrong? Thanks.