It is frustrating that I need to pull the data from SQL server using complex queries and then format it in Excel to ”prettify” the data. Thankfully, I can use the Microsoft query in Excel to get the data from SQL server and create a table or a PivotTable. Today, I encountered a problem with the case statement.
Although my syntax was right, MS Query kept throwing exception about the CASE statement. I read some discussions on-line, and some people had the wrong syntax, such as including the alias of the case statement in the group by statement. I did not have that problem. Finally, I found the solution: It was the order by clause. I was using the alias of the case statement in the order by clause. I removed it and the query ran just fine.
Well, I got this error message today while I was trying to import a text file:
“The search key was not found in any record”
After some research, I found that either it was a bug caused by Microsoft Jet 4.0 Service Pack or it was the size of the database (should be not greater than 2GB). It turned out to be the later one. I fixed this problem by compacting and resizing the database. In Access 2007, you click on the Office Button (Top Left Corner), then Manage > Compact and Repair Database.
I was trying to enable an add-in for Excel 2007, and I kept getting this error:
Access to the VB project is not trusted
You can turn this message off by going to Developer tab in the ribbon and then clicking on the Macro security button, and checking the check box for “Trust access to the VBA project object model.”
A word of caution: be wary of the add-ins/projects that need VBA access. Don’t allow any project/add-in with VBA access, unless you know its exact purpose or the author of that project.
This is a new one for me. One good thing working with Excel and Access is the Copy/Paste ease between them. I usually paste data from Excel to Access for these two reasons:
- Create tables in Access (for small tables)
- Paste Field names: either in a table or in the import specs form
When I am importing data of the web, usually they have field names and data types given that page, so it makes sense to import that table in Excel (using Import from Web option), and then copy the field names and directly paste them the import specs form in Access. However, I kept running in this error today, which MS acknowledged and provided a solution, caused due to a security patch.
I used a workaround to paste those field names: copy and paste the data in a text file, and the again copy and paste it in Excel.
Solution Update: provided one more MS KB number to fix this problem. So, there are two KB articles which acknowledge this problem:
KB967699: http://support.microsoft.com/kb/967699
KB958437: http://support.microsoft.com/kb/958437
When I tried to export a table/query from Access 2007 to Excel 2007, I was getting this annoying error:
You selected more records than can be copied onto the Clipboard at one time. Divide the records into two or more groups, and then copy and paste one group at a time. The maximum number of records you can paste at one time is approximately 65,000.

Access 2007 Export to Excel Error
I was unable to understand the reason, because I thought Excel 2007 did not limit number of rows to 65,536. It turns out however that it is the clipboard limitation.
Solution: If you check off the “export data with formatting and layout” option, Access exports successfully.
You can export successfully using Transferspreadsheet (VBA) option too.
Here is the KB from MS.
Solution Update:Thanks to Brett, it looks like that only if you export table/query using right click > Export and have the checkbox cleared, then Access will export succesfully. That is what I always do, and it works for me. I have never tried External data option for exporting.
Recent Comments