By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,478 Members | 1,709 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,478 IT Pros & Developers. It's quick & easy.

Unicode Compression not working under DAO.

P: n/a
I've been having a hard time getting the benefits that Unicode
Compression offers (2003 Access). I've got a test database that I'd
like to set the Unicode Compression for the fields. For this test I've
got a simple table with 16 text fields with size 255 each.

Now I'd like to modify the UC property in code. One of them with DAO
like so...

Set db = CurrentDb()
Set tdef = db.TableDefs("Testtable")
For Each fld In tdef.Fields
fld.Properties.Append fld.CreateProperty("UnicodeCompression",
dbBoolean, True)
fld.AllowZeroLength = True

the other with ADO...

Set cmd = New ADODB.Command
cmd.ActiveConnection = CurrentProject.AccessConnection
strsql = "ALTER TABLE Testtable " & _
cmd.CommandText = strsql

Each time I go into the table design and verify that the compression
was successfully set.

Now I try to fill the table. 255 "x" in each field until I get a
record too large error. With the DAO update I get 2019 characters
before it blows up. This is the same number I'd get if I had set
Unicode Compression = False. With the ADO call (for all 16 text fields)
it crashes at a healty 4004 characters. Why is it that it didn't work
under DAO?

Also, I get a "Record Too Large" error when modifying the database with
Unicode Compression *after* the record is moderatly populated (but not
too large). I have been trying to find any documentation of these
issues with no luck.

BTW the code that I use to fill the table is basically this:

For j = 0 To numfields
f$ = "fname" & j
MyDS(f$) = String$(250, "x")

Any help would be appreciated. Thank you.


Feb 14 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.