Invalid Bracketing of name

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Invalid Bracketing of name

Post by matthewR »

I am trying to use the import external data in Excel 2003 (not upgraded to 2007 yet). I am getting the error "Invalid Bracketing of name 'mdb.'. (see attachment). I make a table of the query I am using because the query uses the NZ function and I get an error so I make the query into a table. It looks like the name of the database is Ok but not sure where to look for an invalid bracketing.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Invalid Bracketing of name

Post by HansV »

Do you have Office 2003 and Office 2007 installed on this PC?
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

I don't know. What would I look for to see if Office 2007 is installed? I have excel 2003, Word 2003 and Access 2003. I have Outlook 2007.

I copied the database and the excel file to the C drive and I do not get this error. The database and the excel file were on a network drive. Why would a network drive cause this error?

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Invalid Bracketing of name

Post by HansV »

You have at least part of Office 2007 since you have Outlook 2007.
Try this:

- In Excel, select Tools | Get External Data | New Database Query...
- Select MS Access Database as data source.
- Clear the check box "Use the Query Wizard to create/edit queries", then click OK.
- Select the database, then click OK.
- If you're prompted for a username and password, specify admin for the username and leave the password blank.
- Select the table, then click Add, next click Close.
- Double-click the asterisk * at the top of the field list, or double-click only the fields that you want to import.
- Click the SQL button. You'll see the SQL statement that will be used to import the data.
- Scroll down until you see the FROM part.
- It should look similar to this:

FROM `C:\Databases\MyDatabase.mdb`.tblSomething tblSomething

- Make sure that there are no extra ` characters in there.
- You can also try removing the .mdb part so that it looks like

FROM `C:\Databases\MyDatabase`.tblSomething tblSomething

- Click OK, then click File | Return data to Microsoft Excel.
- You'll now return to Excel where you can specify where you want the data.
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

Thanks Hans, I will try that. Right now it works on C but I would like to put it on the network drive in case my computer crashes.

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

Hans - I followed your instructions for the database that is on the network drive. Following your directions and not using the Query Wizard to create/edit query, I didn't get the error. I am not sure why it worked because I didn't do anything to the FROM clause in the SQL. It didn't have anything with mdb in it. Thank you for your help.

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

I am back again with the same problem but a different error. I am on a network drive. ( I copied the database to the C drive and it works there). I am trying to Import external data. I am now getting "The microsoft office access database engine cannot find the input table or query "mdb.PamMtable". I tried the way you said earlier but when I double click the * to bring down the fields, I get that error. I can't look at the SQL at this point because there isn't anything when I click the SQL button. I am on the same drive as the last database. The other database (by using your suggestion) works fine on the network drive. I created another spreadsheet and did the import external data and it didn't give me any errors. :scratch:

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Invalid Bracketing of name

Post by HansV »

Can you add a single field instead of * ?
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

No, I tried but I get that error.

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Invalid Bracketing of name

Post by HansV »

Try this, after adding the table:
Click the SQL button. The window will be empty, but don't worry.
Enter the following SQL statement:

SELECT * FROM PamMTable

assuming that PamMTable is indeed the one you want to use.
Click OK.
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

I put the select statement in the blank SQL but it still gives me the same error. It must be a network thing because I have no problem on the C drive.

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Invalid Bracketing of name

Post by HansV »

And if you use

SELECT * FROM "networkpath\databasename.mdb".PamMTable PamMTable

with the correct path and filename substituted?
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

Hans:

That worked. Thank you very much for your help.

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Invalid Bracketing of name

Post by HansV »

Phew!
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

Another question (or problem). I just got an email that they are moving all our files to another drive. I just setup all my connections from my databases to Excel which included the above scenario. Will I have to redo everything since my database and Excel spreadsheets will be moved to another drive?

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Invalid Bracketing of name

Post by HansV »

Jan Karel Pieterse has written a free utility Query Manager that lets you edit the path to the data source of database queries in Excel. You can download Query Manager from JPK-ADS Download Page.
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

Thanks Hans - I will take a look at that.

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

I loaded the add in. I can see where to edit the path. Once we change to 2007, will I be able to load the Add-in?

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Invalid Bracketing of name

Post by HansV »

Yes, it'll work in Excel 2007 too.
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Invalid Bracketing of name

Post by matthewR »

The query manager works perfectly except on the excel sheet where I had to use the SQL (SELECT * FROM "networkpath\databasename.mdb".PamMTable PamMTable)
that you gave me. Attached are screen prints of the Query manager - before changed path and after. The error I am getting is that it is not a valid path. I changed the path in the SQL too.
You do not have the required permissions to view the files attached to this post.
Last edited by matthewR on 19 May 2011, 17:06, edited 1 time in total.