Fixup ODBC :connection-string codepath.
authorNathan Bird <nathan@acceleration.net>
Wed, 4 Jan 2012 20:37:15 +0000 (15:37 -0500)
committerNathan Bird <nathan@acceleration.net>
Wed, 4 Jan 2012 21:15:58 +0000 (16:15 -0500)
In the call to odbc's SQLDriverConnect default the WindowHandle
argument to a null ptr so that connecting with :connection-string will
work in the default case of SQL_DRIVER_NOPROMPT.

I.e. you can now do things like: (clsql:connect '("DsnName" "UserName"
"" :connection-string
"DRIVER={FreeTDS};SERVER=...;DATABASE=...;UID=...;PWD=...;PORT=1433;TDS_Version=8.0;APP=clsql"
:database-type :odbc))

I believe the DsnName and Username at that point are only used when
printing the connection information.

When connecting with ODBC :connection-string argument default the
window-handle (for popping up a prompt) to the null ptr in the case
that one hasn't been passed in.

The default is to tell the driver library not to prompt so it doesn't
really need a window handle, it just needs it to be a null ptr rather
than nil.

ChangeLog
db-odbc/odbc-api.lisp

index b8293b30dc122f80602b0799413bf38a716b4117..9107ff22b4851987cb743f4a28d2a161fa547471 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2012-01-04  Nathan Bird  <nathan@acceleration.net>
+
+       * db-odbc/odbc-api.lisp (%sql-driver-connect): in the call to
+       odbc's SQLDriverConnect default the WindowHandle argument to a null ptr so
+       that connecting with :connection-string will work in the default
+       case of SQL_DRIVER_NOPROMPT.
+
+       I.e. you can now do things like:
+       (clsql:connect '("DsnName" "UserName" "" :connection-string
+       "DRIVER={FreeTDS};SERVER=...;DATABASE=...;UID=...;PWD=...;PORT=1433;TDS_Version=8.0;APP=clsql"
+       :database-type :odbc))
+
+       I belibe the DsnName and Username at that point are only used when
+       printing the connection information.
+
 2011-12-20  Kevin Rosenberg <kevin@rosenberg.net>
        * Version 6.1.1
        * db-oracle/oracle.lisp: Typo correction (Elias Martenson)
index 9ebdb3e6e506475104869f55624219851192b0e8..b20a48aba469295b11880ca8326fec7c196d9d29 100644 (file)
@@ -226,7 +226,8 @@ May be locally bound to something else if a certain type is necessary.")
        (with-error-handling
            (:hdbc hdbc)
            (SQLDriverConnect hdbc
-                             window-handle
+                             (or window-handle
+                                 +null-handle-ptr+)
                              connection-ptr $SQL_NTS
                              completed-connection-string-ptr $SQL_MAX_CONN_OUT
                              completed-connection-length