question

ADezii-4897 avatar image
ADezii-4897 asked ·

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.

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-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DSPatrick avatar image
DSPatrick answered ·

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.





Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.