Solved

Access SQL Create Table with Hyperlink and attachment fields

Posted on 2013-06-18
3
1,018 Views
Last Modified: 2013-06-19
Hi
I am using the following SQL in Access to create a test table. The only two fields that
cause problems are the Hyperlink and Attachment fields. What is the correct syntax
for these:

CREATE TABLE tblTest3
    (CustomerID INTEGER NOT NULL,
    [Test] YesNo,
    [Docs] Attachment,
    [Link] Hyperlink,
    Phone OLEObject,
    Email TEXT(50))
0
Comment
Question by:murbro
3 Comments
 
LVL 26

Assisted Solution

by:jerryb30
jerryb30 earned 200 total points
ID: 39257789
AFAIK, hyperlink data type cannot be created with data definition language (SQL).
Probably same for attachment.
0
 
LVL 24

Accepted Solution

by:
chaau earned 300 total points
ID: 39258362
Jet SQL doesn't support creating attachment fields. You can use DAO for this purpose:
Sub Test()
    Dim dbs As DAO.Database
    Dim tdf As DAO.TableDef
    Dim fld As DAO.Field
    Set dbs = CurrentDb
    Set tdf = dbs.CreateTableDef(Name:="tblTest3")
    Set fld = tdf.CreateField(Name:="Docs", Type:=dbAttachment)
    tdf.Fields.Append fld
    dbs.TableDefs.Append tdf
    dbs.TableDefs.Refresh
End Sub

Open in new window

0
 

Author Closing Comment

by:murbro
ID: 39258704
Thanks very much
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now