Does anyone know how to 'pro-grammatically' create an Attachment Field in an Access Table using DDL? The following Code does NOT add the [Attachments] Field to the [Students] Table. All works well up to that point.

ADezii 46 Reputation points
2020-06-03T22:52:08.563+00:00

On Error Resume Next

CurrentDb.TableDefs.Delete "Students"

Dim strSQL As String

strSQL = "CREATE TABLE [Students] ([ID] COUNTER,[Last Name] VARCHAR(50), " & _
"[First Name] VARCHAR(50), [E-mail Address] VARCHAR(50), [Student ID] VARCHAR(20), " & _
"[Level] VARCHAR(30), [Room] VARCHAR(20), [Date of Birth] DATETIME, [ID Number] VARCHAR(255), " & _
"[Home Phone] VARCHAR(25), [Mobile Phone] VARCHAR(25), [Address] VARCHAR(255), " & _
"[City] VARCHAR(50), [State/Province] VARCHAR(50), [ZIP/Postal Code] VARCHAR(15), " & _
"[Country/Region] VARCHAR(50), [Web Page] MEMO, [Notes] MEMO, [Attachments] ATTACHMENT);"

CurrentDb.Execute strSQL, dbFailOnError

RefreshDatabaseWindow

DoCmd.SelectObject acTable, "Students", True

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,457 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dave Patrick 426.2K Reputation points MVP
    2020-06-03T22:56:57.673+00:00

    Access is not currently supported here on QnA. I'd try asking for help in dedicated forums here.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=accessdev

    https://answers.microsoft.com/en-us/msoffice/forum/msoffice_access

    --please don't forget to Accept as answer if the reply is helpful--


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    0 comments No comments

0 additional answers

Sort by: Most helpful