Re: VB3 to Oracle Bug

From: Scott Urman <surman_at_oracle.com>
Date: 1995/10/18
Message-ID: <4643nj$3o7_at_inet-nntp-gw-1.us.oracle.com>#1/1


CHAR is a fixed length type. Oracle (or any ANSI database, for that matter) will blank pad any inserted data to the length of the field. If you truely have variable length data, use VARCHAR2.

In article <4635gb$pen_at_newsbf02.news.aol.com>, roywagner_at_aol.com (Roy Wagner) writes:
|> In an Oracle table we defined the first value as:
|>
|> afield not null unique CHAR(4)
|>
|> When trying to use Visual Basic 3.0 with Jet 110 into a table using a
|> DYNASET and the method AddNew, we could not add any records when we
|> entered a value for afield that was less than 4 characters. It crashes on
|> the method Update. The "strange" error from VB was: "Record is Deleted",
|> error number 3167.
|>
|> We tried installing the compatibility version with Jet 112 that lets VB3
|> use the Jet 200 DLL and that WORKED. Installing the compatibility version
|> is not a viable solution because we are not using ACCESS 2.0 and you MUST
|> have this software version installed inorder to use the compatiblily
|> upgrade. (a Microsoft requirement).
|>
|> What is happening is that Oracle is "padding" afield with characters when
|> it is shorter then the defined length and VB3 with Jet 110 does not
|> "recognize" this padding properly.
|>
|> The best solution is to define afield as VARCHAR2(4) instead of CHAR(4),
|> or to require the field entered to be 4 characters.
|>
|>
|>
|>
|> - Roy Wagner -
|> "When driving my Miata, I always get to where I'm going before I want to
|> stop driving it."
  Received on Wed Oct 18 1995 - 00:00:00 CET

Original text of this message