PC Review


Reply
Thread Tools Rate Thread

How do I set Unicode Compression to yes in create table statement?

 
 
Anupam
Guest
Posts: n/a
 
      22nd Feb 2009
I am writing this code which is generating error:-
dbs.Execute "CREATE TABLE Property_Ledger_Temp (Ledger CHAR(26)NOT NULL WITH
COMPRESSION, Vr LOGICAL,CONSTRAINT Ledger UNIQUE (Ledger));"
Without Compression the code is executed.
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      22nd Feb 2009
Access DDL is not powerful enough to set these kinds of properties.

Use DAO instead. Set a boolean property called UnicodeCompression on the
field.

There's an example of creating a table in DAO, and setting these properties
here:
http://allenbrowne.com/func-DAO.html
Scroll down the page to this function to see how to set the properites:
Function StandardProperties(strTableName As String)

There are several important properties you cannot set via DDL, e.g.
AllowZeroLength.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Anupam" <(E-Mail Removed)> wrote in message
news:4B9F5711-19D0-4DEB-B8E7-(E-Mail Removed)...
>I am writing this code which is generating error:-
> dbs.Execute "CREATE TABLE Property_Ledger_Temp (Ledger CHAR(26)NOT NULL
> WITH
> COMPRESSION, Vr LOGICAL,CONSTRAINT Ledger UNIQUE (Ledger));"
> Without Compression the code is executed.


 
Reply With Quote
 
David W. Fenton
Guest
Posts: n/a
 
      23rd Feb 2009
"Allen Browne" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Access DDL


There is no such thing as "Access DDL," only Jet DDL.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 
Reply With Quote
 
RoyVidar
Guest
Posts: n/a
 
      24th Feb 2009
Anupam wrote:
> I am writing this code which is generating error:-
> dbs.Execute "CREATE TABLE Property_Ledger_Temp (Ledger CHAR(26)NOT
> NULL WITH COMPRESSION, Vr LOGICAL,CONSTRAINT Ledger UNIQUE
> (Ledger));" Without Compression the code is executed.


"Note that the WITH COMPRESSION and WITH COMP keywords are declared
before the NOT NULL keywords."
http://msdn.microsoft.com/en-us/library/aa140015(office.10).aspx

dbs.Execute "CREATE TABLE Property_Ledger_Temp (" & _
"Ledger CHAR(26) WITH COMPRESSION NOT NULL, " & _
"Vr LOGICAL, " & _
"CONSTRAINT Ledger UNIQUE (Ledger))"

You might want to also ensure the Zero Length Property is set to
False, which cannot be set with DDL, but various ways through code.

Here is one utilizing ADOX.Catalog.

With CreateObject("ADOX.Catalog")
Set .ActiveConnection = dbs
.Tables("Property_Ledger_Temp").Columns("Ledger").Properties( _
"Jet OLEDB:Allow Zero Length").Value = False
End With

If you can use DAO, that will probably prove to be significantly faster

--
Roy-Vidar


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unicode Compression =?Utf-8?B?UGV0ZXIgSGlsbA==?= Microsoft Access ADP SQL Server 1 26th Jul 2005 04:31 AM
How do I know programatically if a table/field has 'Unicode Compression'? Evan Camilleri Microsoft Access VBA Modules 3 3rd Nov 2004 09:43 AM
How do I know programatically if a table/field has 'Unicode Compression'? Evan Camilleri Microsoft Access Database Table Design 1 3rd Nov 2004 09:25 AM
Unicode Compression? Paul Fenton Microsoft Access 3 26th Oct 2004 12:55 AM
unicode compression Steve Microsoft Access Database Table Design 1 17th Jun 2004 06:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:45 PM.