pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <inoue@tpf.co.jp>
To: 'Ben Ramsey' <br@benandliz.com>
Cc: 'Jeff Eckermann' <jeff_eckermann@yahoo.com>
Cc: pgsql-odbc@postgresql.org
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> (raw)
In-Reply-To: <400EB4BE.50109@benandliz.com>

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)
> 




view thread (15+ messages)  latest in thread

Message-ID: <027b01c3e067$fb439730$3d283ddb@PbgX>
Permalink:  ../027b01c3e067$fb439730$3d283ddb@PbgX/
Also on:    postgresql.org/message-id/027b01c3e067$fb439730$3d283ddb@PbgX

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: inoue@tpf.co.jp, br@benandliz.com, jeff_eckermann@yahoo.com
  Subject: Re: Adding long text to a text field generates an error
  In-Reply-To: <027b01c3e067$fb439730$3d283ddb@PbgX>
  References: <400EB4BE.50109@benandliz.com> <027b01c3e067$fb439730$3d283ddb@PbgX>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox