The text file specification <name> does not exist, when using SQL IN statement to link to external MS Access database.

LucasParker

New Member
Joined
Sep 25, 2014
Messages
2
I am trying to use MS Access to query an MS Access database that is not the current database. I am using:

<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">SELECT [tblA].[fieldA]
FROM [tblA]
IN "G:\path\databaseA.mdb" "Microsoft.ACE.OLEDB.12.0;"
WHERE ((([tblA].[fieldA])="30000"));

</code>Running this query returns the error <code style="margin: 0px; padding: 1px 5px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: pre-wrap; background: rgb(238, 238, 238);">Could not find installable ISAM.</code>

I thought the connect string might not be necessary when connecting to another MS Access database (extension .mdb) so I also tried:

<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">SELECT [tblA].[fieldA]
FROM [tblA]
IN "G:\path\databaseA.mdb"
WHERE ((([tblA].[fieldA])="30000"));</code>

However, this returns the error "The text file specification <name> does not exist. You cannot import, export, or link using the specification."

Does anyone know a way around this?

Thank you for any help,

Lucas

</name>
 
Last edited:

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,508
Office Version
  1. 365
Platform
  1. Windows
Welcome to the Board!

One way is to create a linked table to the table in the other Access database. Then you can just use this linked table in a query just like you would any other Access table.
 

LucasParker

New Member
Joined
Sep 25, 2014
Messages
2
Welcome to the Board!

One way is to create a linked table to the table in the other Access database. Then you can just use this linked table in a query just like you would any other Access table.


Thanks Joe,

I am trying to do this without creating linked tables. I have to pull and append data from 5 different Access databases with over 10 tables in each database. I need to be able to do this repeatedly with different WHERE conditions each time. That is why I am trying to figure out how to do it with SQL.

Any ideas would be appreciated, as I am relatively new to Access.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,436
Messages
5,528,758
Members
409,834
Latest member
vexceled

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top