I create a table with the following SQL using oledbconnection or immediately in access (installed version Office 365 MSO 32-bit and ACE 2016 32-bit):
CREATE TABLE Ticket (
[ID] COUNTER
, [Kundennummer] CHAR(15)
, [DC] CHAR(5)
, [Auftragsnummer] CHAR(25)
, [OZ] CHAR(5)
, [ASS] CHAR(20)
, [ASB] CHAR(5)
, [SPATZ] CHAR(19)
, [Status_num] INTEGER
, [Status_text] CHAR(255)
, [Bearbeitet_timestamp] DATE
, [IMPORT_ZEITSTEMPEL] DATE
, [RESULT_ZEITSTEMPEL] DATE
, CONSTRAINT [PrimaryKey] PRIMARY KEY ([ID])
);
The created table with "create table" always has the full restricted length for all fields with restricted length.
When I add a record in Access or via oleDbConnection, every field is padded to its full length with spaces.
How can I write the Create Table SQL in such a way that the table is created in such a way that only the actual field content is accepted. Or is there a setting in Access? A table created with Access does not show this behavior.
Please help, thank you
Use a VARCHAR field for a character field of varying length.
CHAR is fixed length so always needs to be fully filled, and pads with spaces if it isn't. While the GUI in Access doesn't support creating them, Access handles them just fine and just like most RDBMSes would.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With