X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7826BD1E9C0 for ; Wed, 21 Jan 2004 17:44:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 94988-06 for ; Wed, 21 Jan 2004 13:43:57 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 4CF98D1EB6B for ; Wed, 21 Jan 2004 13:37:57 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i0LHbrU6088631 for ; Wed, 21 Jan 2004 17:37:53 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i0LHJwd3085833 for pgsql-odbc@postgresql.org; Wed, 21 Jan 2004 17:19:58 GMT From: Ben Ramsey X-Newsgroups: comp.databases.postgresql.interfaces.odbc Subject: Re: Adding long text to a text field generates an error Date: Wed, 21 Jan 2004 12:19:58 -0500 Organization: Hub.Org Networking Services Lines: 181 Message-ID: <400EB4BE.50109@benandliz.com> References: <400C5CBA.7030802@benandliz.com> <20040119230203.70409.qmail@web20808.mail.yahoo.com> <400C66A1.7090901@benandliz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org Cc: Jeff Eckermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en In-Reply-To: <400C66A1.7090901@benandliz.com> To: pgsql-odbc@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/69 X-Sequence-Number: 3698 It seems that I /was/ a bit to optimistic, indeed. Here's the problem I'm having now, and I didn't know this was a problem until I heard it from the client. The problem is that I can *update* records just fine after setting the Max LongVarChar above 8190, but I cannot *add* new records. I get this error instead: Microsoft OLE DB Provider for ODBC Drivers error '80004005' can't alloc Desc Handle yet /cora/coraModules/news/newsUpdate.asp, line 1054 When I set the value back to 8190, I can add new records and update records just fine (as long as I don't go over that value). Here's the code I'm using to add new records (keep in mind that this is ASP using ADO to update the database--do not me to switch it to a SQL statement, it still will not work, as I have already tried): Set DBConn = Server.CreateObject("ADODB.Connection") DBConn.Open "DSN=DatasourceName;UID=username;PWD=password;" Set NewsRS = Server.CreateObject("ADODB.Recordset") NewsRS.CursorLocation = adUseServer NewsRS.CursorType = adOpenKeyset NewsRS.LockType = adLockOptimistic NewsRS.Open "tblNews", DBConn, , , adCmdTable NewsRS.AddNew NewsRS("DateAdd") = Now NewsRS("Keywords") = Keywords NewsRS("DateModified") = Now If (StrComp(ArtType,"1") = 0) Then NewsRS("News") = 1 Else NewsRS("News") = 0 End If If (StrComp(ArtType,"2") = 0) Then NewsRS("Topic") = 1 Else NewsRS("Topic") = 0 End If If (StrComp(ArtType,"3") = 0) Then NewsRS("Review") = 1 Else NewsRS("Review") = 0 End If NewsRS("ReleaseDate") = ValidDate NewsRS("Title") = ArtTitle If ArtPDF Then NewsRS("PDFLink") = 1 Else NewsRS("PDFLink") = 0 End If NewsRS("PDFURL") = ArtPDFFile If (StrComp(ArtCopyType, "HTML", vbTextCompare) = 0) Then NewsRS("FormatHTML") = 1 Else NewsRS("FormatHTML") = 0 End If If (StrComp(ArtCopyType, "Text", vbTextCompare) = 0) Then NewsRS("FormatText") = 1 Else NewsRS("FormatText") = 0 End If If ArtPressRelease Then NewsRS("PressRelease") = 1 Else NewsRS("PressRelease") = 0 End If If ArtCalendar Then NewsRS("Calendar") = 1 Else NewsRS("Calendar") = 0 End If If ArtHome Then NewsRS("HomePage") = 1 Else NewsRS("HomePage") = 0 End If If ArtRevised Then NewsRS("Revised") = 1 NewsRS("RevisedOn") = ValidRevisedDate Else NewsRS("Revised") = 0 End If NewsRS("ArticleCopy") = ArtCopy NewsRS.Update NewsRS.Close Set NewsRS = Nothing DBConn.Close Set DBConn = Nothing Line 1054 is NewsRS.Update. ArticleCopy is the "text" column in the database. Here is the SQL code I've dumped from PostgreSQL for "tblnews": CREATE TABLE tblnews ( id serial NOT NULL, keywords character varying(255), dateadd timestamp without time zone, datemodified timestamp without time zone, news boolean DEFAULT 'f', topic boolean DEFAULT 'f', review boolean DEFAULT 'f', releasedate timestamp without time zone, revised boolean DEFAULT 'f', revisedon timestamp without time zone, title character varying(255), pdflink boolean DEFAULT 'f', pdfurl character varying(255), pressrelease boolean DEFAULT 'f', calendar boolean DEFAULT 'f', homepage boolean DEFAULT 'f', enteredby character varying(50), formattext boolean DEFAULT 'f', formathtml boolean DEFAULT 'f', articlecopy text ); Here are the settings I have for my DSN (ODBC settings): Disable Genetic Optimizer (checked) KSQO (Keyset Query Optimization) (checked) Recognize Unique Indexes (checked) Use Declare/Fetch (unchecked) CommLog (unchecked) Parse Statements (unchecked) Cancel as FreeStmt (unchecked) MyLog (unchecked) Unknown Sizes = Maximum Text As LongVarChar (checked) Unknowns As LongVarChar (unchecked) Bools As Char (checked) Max Varchar = 254 Max LongVarChar = 163800 Cache size = 100 SysTable Prefixes = dd_; Read Only (unchecked) Show System Tables (unchecked) LF <-> CR/LF conversion (checked) Updateable Cursors (checked) bytea As LO (unchecked) Row Versioning (unchecked) Disallow Premature (unchecked) True is -1 (unchecked) Server side prepare (unchecked) Int 8 As = default Protocol = 7.X,6.4+ OID Options: Show Column (unchecked) OID Options: Fake Index (grayed out; unchecked and unable to check) Connect settings (empty) The client is very antsy about this and wants it fixed ASAP. Any ideas? -Ben Ben Ramsey wrote: > Jeff Eckermann wrote: > >> We haven't established that this works, yet ;-) > > > Guess I was a bit too optimistic. ;) > > Well, I tried unchecking it, then I tried setting the value higher. > Nothing seemed to work. Then, I got the nifty idea to restart IIS, and > it work! It appears that unchecking it doesn't do anything. So, I had > to just set it to an extremely high value. That did the job. > > Thanks! > > -Ben