Thread: [INTERFACES] C++ Builder (Delphi), ODBC and large objects
21.10.1998 Byron Nikolaidis wrote: >Please send me the psqlodbc.log files showing both the "0-value" error and the >"couldn't open large object for reading". I have type 'lo' created CREATE TYPE lo ( internallength=4, externallength=10, input=int4in, output=int4out, default='', passedbyvalue ); as it is recomended in http://www.insightdist.com/psqlodbc/psqlodbc_faq.html#largeobjects and a table CREATE TABLE tmp_rq ( req_id int2, req_content lo ); I manually (to simplify debugging) insert record with req_id = 1. In my application I have an SQL (RequestLive), SELECT req_id, req_content FROM tmp_rq WHERE req_id = 1; It binded to TDBRichEdit (TDBMemo) component. I run the application, write text (long) to the large object field fromTDBRichEdit, and exit. I'm attaching psqlodbc.log file renaming it to WriteData.log Then run the application again try to read data from large object field by TDBRichEdit (nothing is showed), and exit. This time I renamed psqlodbc.log file to ReadAfterWriteData.log I can see there are some information you don't need, but I decided to leave the files as is not to remove something valuable by ignorance. >Also, send the odbc trace log files (sql.log) as well showing the results of >both the read and write attempts. Make sure the log file is clean before you begin. In both cases described above sql.log file was emty. To try to get the files I did the following: In MS 32-bit ODBC I checked "All the time" ("When to trace" on "Tracing" page)" and press "Start tracing Now" button. In ODBC Administrator (PostOdbc driver) I set Trace mode = 0x0040 Here is quoting from "ODBC driver connection settings" help: TRACE MODE A numeric value (bit mask) specifying how much trace information to log. The Windows OutputDebugString call is used to output the requested information to the debug window. The following table shows which information is logged based on bit settings: Bit Settings Logged Information 0x0001 prepared query statement 0x0002 executed query statements 0x0004 vendor errors 0x0008 statement options (that is: allocate, free) 0x0010 connect / disconnect 0x0020 transaction 0x0040 BLOB I/O 0x0080 miscellaneous 0x0100 vendor calls But I do get 488 KB sql.log file when I create large object. I'm not attaching it because I don't know whether you need it. If you do I'll send it too. I got a message from Sergey E. Levov <serg@informika.ru> he writes: >If you have sources try the follwing: >Find the string > if (pcbValue && *pcbValue <= SQL_LEN_DATA_AT_EXEC_OFFSET) >in the file bind.c and change it into > if (pcbValue && ((*pcbValue <= SQL_LEN_DATA_AT_EXEC_OFFSET) || > (*pcbValue == SQL_DATA_AT_EXEC))) >and rebuild the driver. Perhaps it help. I downloaded sources from www.insightdist.com/psqlodbc. Unfortunatelly I need MS Visual C++ 4.0 to rebuild the driver which I haven't. I am seeking an opportunity to do the job now. Thank you, Mikhail.
Attachment
>Sergio wrote: >> well, then the only thing that I can tell is that no one of the three >> set of components that I tryed (mOdbc, odbc98, OdbcExpress) work well >> with the pg odbc driver, and yes, I've configured it for odbc cursor >> library and tryed all kinds of setup. >> > >I corrected some things in the odbc driver to work better with OdbcExpress. The >latest version (.250) of our driver has at least 2 fixes that were prompted by >OdbcExpress. > >I know that odbcexpress talks to the driver manager, which converts the 3.0 >calls to 2.0 calls. > >When you say, OdbcExpress doesn't work well with the driver, what exactly is the >problem? Can you be specific, and show log files, etc. Well, my previous problem ('[Microsoft][ODBC driver manager] Fetch type out of range') dissappear when I changed the option hStm -> CursorType from Keyset Driven to Static. Now when I try to edit a field in a DBGrid and when I post this message is raised: '[Microsoft][ODBC cursor library] Syntax error or access violation' and I can't post it. But I don't worry any more about Odbc98 nor OdbcExpress, now I'm comitted to mOdbc because the author is willing to release the sources. Btw, using mOdbc this error is raised when I launch the app: '[Microsoft][ODBC driver manager] The driver doesn't support the version of ODBC behavior that the application requested (See SQLSetEnvAttr)', and then say: '[Microsoft][Odbc curosr library] HSTMT bindings may not be changed while a cursor is open' but it open the table and show the result of the query normally. I'm using it with ODBC cursor library and static cursors. The Home page of mOdbc is http://www.chat.ru/~ksav it work in Delphi 3 and BCB 3. Sergio PS: I don't see any strange in the log files, but if you want it anyway, tell me and I'll send it to you. Btw, this mailing list accept attachs ?