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 9221FD1E8D8 for ; Wed, 21 Jan 2004 21:46:48 +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 43773-10 for ; Wed, 21 Jan 2004 17:46:18 -0400 (AST) Received: from sd.tpf.co.jp (mail.tpf.co.jp [210.161.239.34]) by svr1.postgresql.org (Postfix) with SMTP id 03FCAD1E841 for ; Wed, 21 Jan 2004 17:46:14 -0400 (AST) Received: (qmail 10282 invoked from network); 22 Jan 2004 06:46:13 +0900 X-Authentication: inoue was authenticated by ftp.tpf.co.jp at 22 Jan 2004 06:46:13 +0900 Received: from unknown (HELO PbgX) (219.61.40.61) by ftp.tpf.co.jp with SMTP; 22 Jan 2004 06:46:13 +0900 From: "Hiroshi Inoue" To: "'Ben Ramsey'" Cc: "'Jeff Eckermann'" , Subject: Re: Adding long text to a text field generates an error Date: Thu, 22 Jan 2004 06:46:09 +0900 Message-ID: <027b01c3e067$fb439730$3d283ddb@PbgX> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <400EB4BE.50109@benandliz.com> Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/72 X-Sequence-Number: 3701 Please try the dll at http://www.geocities.jp/inocchichichi/psqlodbc/ . regards, Hiroshi Inoue > -----Original Message----- > From: Ben Ramsey > > 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 > > ---------------------------(end of > broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to > majordomo@postgresql.org) >