Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 26th, 2004, 05:52 AM
Friend of Wrox
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default Linked table issue


I have a db which needs to use the exported report from a 3rd party application in a query. Every time the 3rd party application runs the report it exports a file to the root of c:, but unfortunately this doc is named .doc even though it is a csv. So, when I try to link to it, it kicks me out, as soon as I rename to .csv it is fine.

It is not practical to rename the file locally, as this file is also used by other applications too. So, does anyone know if there is a way or a setting to allow .doc to be a source for a linked table and if so, how do I do it?

Cheers all...
Old November 26th, 2004, 12:46 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts

Does this help:

Public Sub ImportText()
  DoCmd.TransferText acImportDelim, , "TestQuery", "e:\My Documents\textforimport.doc"

End Sub

Best wishes,

Clive Astley
Old November 26th, 2004, 01:28 PM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts


   Your best bet is to confirm the existence of the file first, and then copy with the csv extension.

   This works in vbscript:

Dim objFSO
Dim boolExists

Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")

If IsObject(objFSO) Then
    boolExists = objFSO.FileExists("C:\Test.doc") 'returns -1 if file exists
End If

If boolExists = -1 Then
    objFSO.CopyFile "C:\Test.doc", "C:\Test.csv"
End If

Of course once again I can't get it to work in VBA.

I hope this gets you started.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read-Only Linked Table pjm Access 6 August 21st, 2006 07:42 AM
Can a Make Table Query produce a Linked table? kronik Access 5 May 16th, 2006 06:17 AM
Linked Table sdilucca Access 1 February 24th, 2006 07:29 AM
linked table Tasha Access VBA 1 August 6th, 2004 03:04 PM
Help! Detect if linked table is available giswim Access VBA 2 October 3rd, 2003 06:39 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.