-1

With Access 2002, I fail to escape the ] character in a database path in a query like this :

SELECT * FROM [MS Access;DATABASE=D:\bd].mdb;].[MYTABLE];

What I've tried and doesn't work :

SELECT * FROM ["MS Access;DATABASE=D:\bd].mdb;"].[MYTABLE];

SELECT * FROM [MS Access;"DATABASE=D:\bd].mdb";].[MYTABLE];

I didn't found anything in msdn documentation about escaping path : http://msdn.microsoft.com/en-us/library/office/ff194542.aspx

(I don't want to use link tables because the query is in fact to export data to excel or another db like SELECT * INTO [text;database=d:\;HDR=Yes].[csvfile.csv] FROM MyTable;)

Vojtech Ruzicka
  • 16,384
  • 15
  • 63
  • 66
PlageMan
  • 708
  • 7
  • 21

1 Answers1

0

try this query..

SELECT [OtherAccessDB].* FROM [OtherAccessDB] IN 'D:\bd].mdb' 

or if the ] isn't required...

SELECT [OtherAccessDB].* FROM [OtherAccessDB] IN 'D:\bd.mdb' 
Christian Phillips
  • 18,399
  • 8
  • 53
  • 82
  • Thanks for your answer, unfortunately it doesn't works with the special characters in path SELECT [MYTABLE].* FROM [MYTABLE] IN 'D:\bd].mdb'; => database engine cannot find 'D:\bd].mdb' – PlageMan Aug 13 '13 at 16:44
  • 1
    In a [similar post](http://stackoverflow.com/questions/251557/escape-angle-brackets-in-a-windows-command-prompt), someone points out that Windows uses the caret as it's escape character. Try `SELECT ... IN 'D:\db^].mdb'` I don't have a virtual with Access handy, but you might try that. @christiandev deserves the answer if that works. – ErinsMatthew Aug 13 '13 at 21:43
  • @ErinsMatthew : Thanks, I tried but it seems that for access, ^ is treated as a regular character. – PlageMan Aug 14 '13 at 08:09