Solved

Access SQL Create Table with Hyperlink and attachment fields

Posted on 2013-06-18
3
1,116 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

724 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