diff --git a/src/interfaces/odbc/convert.c b/src/interfaces/odbc/convert.c
index 7fd1940b00fb4acd0216c756076930cd1389d4bf..4355fdf6f55cbe5145f5528d1401e7dec2bb0814 100644
--- a/src/interfaces/odbc/convert.c
+++ b/src/interfaces/odbc/convert.c
@@ -319,7 +319,7 @@ char tempBuf[TEXT_FIELD_SIZE+5];
 					len = stmt->bindings[stmt->current_col].data_left;
 				}
 				else
-					stmt->bindings[stmt->current_col].data_left = strlen(value);
+					stmt->bindings[stmt->current_col].data_left = strlen(ptr);
 			}
 
 			if (cbValueMax > 0) {
@@ -922,7 +922,7 @@ int lobj_fd, retval;
 			/*	the oid of the large object -- just put that in for the
 				parameter marker -- the data has already been sent to the large object
 			*/
-			sprintf(param_string, "%d", lobj_oid);
+			sprintf(param_string, "'%d'", lobj_oid);
 			strcpy(&new_statement[npos], param_string);
 			npos += strlen(param_string);
 
diff --git a/src/interfaces/odbc/psqlodbc.h b/src/interfaces/odbc/psqlodbc.h
index 6ab559d91ab104c0e89ee8556de75fd6f6b11147..9c6b0388705727d92a5a37daa79e0f55f6c4ebb8 100644
--- a/src/interfaces/odbc/psqlodbc.h
+++ b/src/interfaces/odbc/psqlodbc.h
@@ -39,8 +39,8 @@ typedef UInt4 Oid;
 
 #define DRIVERNAME             "PostgreSQL ODBC"
 #define DBMS_NAME              "PostgreSQL"
-#define DBMS_VERSION           "06.40.0004 PostgreSQL 6.4"
-#define POSTGRESDRIVERVERSION  "06.40.0004"
+#define DBMS_VERSION           "06.40.0006 PostgreSQL 6.4"
+#define POSTGRESDRIVERVERSION  "06.40.0006"
 
 #ifdef WIN32
 #define DRIVER_FILE_NAME		"PSQLODBC.DLL"
@@ -154,7 +154,7 @@ typedef struct QueryInfo_ {
 #define OID_ATTNUM				-2		/* the attnum in pg_index of the oid */
 
 /* sizes */
-#define TEXT_FIELD_SIZE			4094	/* size of text fields (not including null term) */
+#define TEXT_FIELD_SIZE			8190	/* size of text fields (not including null term) */
 #define NAME_FIELD_SIZE			32		/* size of name fields */
 #define MAX_VARCHAR_SIZE		254		/* maximum size of a varchar (not including null term) */
 
diff --git a/src/interfaces/odbc/psqlodbc.rc b/src/interfaces/odbc/psqlodbc.rc
index bec4d3b8892a8612fb4b8245752f8bfb3b7f2cd5..518bc27ba7bdd76ab0aed7c1b879256f73ebffa1 100644
--- a/src/interfaces/odbc/psqlodbc.rc
+++ b/src/interfaces/odbc/psqlodbc.rc
@@ -204,8 +204,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 6,40,0,4
- PRODUCTVERSION 6,40,0,4
+ FILEVERSION 6,40,0,6
+ PRODUCTVERSION 6,40,0,6
  FILEFLAGSMASK 0x3L
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -223,12 +223,12 @@ BEGIN
             VALUE "Comments", "PostgreSQL ODBC driver for Windows 95\0"
             VALUE "CompanyName", "Insight Distribution Systems\0"
             VALUE "FileDescription", "PostgreSQL Driver\0"
-            VALUE "FileVersion", " 6.40.0004\0"
+            VALUE "FileVersion", " 6.40.0006\0"
             VALUE "InternalName", "psqlodbc\0"
             VALUE "LegalTrademarks", "ODBC(TM) is a trademark of Microsoft Corporation.  Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation.\0"
             VALUE "OriginalFilename", "psqlodbc.dll\0"
             VALUE "ProductName", "Microsoft Open Database Connectivity\0"
-            VALUE "ProductVersion", " 6.40.0004\0"
+            VALUE "ProductVersion", " 6.40.0006\0"
         END
     END
     BLOCK "VarFileInfo"