Solved

Access SQL Create Table with Hyperlink and attachment fields

Posted on 2013-06-18
3
1,085 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 25

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

726 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