• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 692
  • Last Modified:

Creating Memo fields with ADOX

I'm using ADOX to create a local table in order to cache records from my SQL Server database. I'm writing my code so that the table will automatically be deleted and recreated should the structure of the SQL Server table change.

One field in the SQL Server table is declared as varchar(500). Because of the size, this means that a memo field is necessary in my Access table. My problem is that there doesn't appear to be a constant available to declare the Memo data type in ADOX. Here's the list of data types I am using. Is it incomplete?


2 Solutions
Leigh PurvisDatabase DeveloperCommented:
Nope adLongVarWChar
This seemed to work as expected

    Dim cat As ADOX.Catalog
    Dim tbl As ADOX.Table

   Set cat = New ADOX.Catalog
   Set tbl = New ADOX.Table
   cat.ActiveConnection = CurrentProject.Connection
   tbl.Name = "testThis"
   tbl.Columns.Append "ValidColumn", adInteger
   tbl.Columns.Append "MyMemo", adLongVarWChar
   cat.Tables.Append tbl

ipendleburyAuthor Commented:
Yes, it was there all along. I expected it to be called adMemo or something. I've just tried it and it works fine.

Thanks for your help guys.


Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now