Anupam said:
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