Skip to main content

Posts

Export Query and Table structure details from Access using VBA

I am busy migrating an Access system, and documenting, so I need a way to document the SQL Queries and Table details. After initially trying to get Access's documentation tool to give me what I needed, I started looking for alternatives. The below code is partly mine and based on the websites mentioned in the comments. Essentially it exports Query and Table information into 3 files in the tmp directory. I tried to do the SQL queries using CSV but even using "'" and """ did not work, so change it to TABS. This means that you can get most of the details for structures in a usable format (not like the Database Documenter which provides unusable details) so here is the code that I ended up with, thought I would share it: Public Sub GetQrysAndTbls() ' Using a few items found on the internet write query and table definitions ' to a text file including field detail for tables ' Original posts found at: ' http://www.techrepubli...

How to Enable / Edit VBA in Outlook 2010

Seem as there are a few forums out there that I had to scan through to find this I thought I would post this so that people can see how to get their VBA code from previous versions of Outlook across when they upgrade to Outlook2010. Macros and the Visual Basic Editor Now that you know something about how Office 2010 applications expose their object models, you are probably eager to try calling object methods, setting object properties, and responding to object events. To do so, you must write your code in a place and in a way that Office can understand; typically, by using the Visual Basic Editor. Although it is installed by default, many users do not know that it is even available until it is enabled on the ribbon. Opening the Developer Tab All Office 2010 applications use the ribbon. One tab on the ribbon is the  Developer  tab, where you access the Visual Basic Editor and other developer tools. Because Office 2010 does not display the  Developer  tab by default, you must enable it b...

Access conversion NOTE1: default DateSerial in VBA/Access to SQL

I have started slowly converting my Access database to SQL. The reason is that I would like to take the application online. After trying to use Access's (version 2007) transfer tool, which did not work that well. I found Microsoft's SQL Migration Assistant 2008 for Access, nicknamed SSMA. Which you can download here . When you install there is a niggle about the license, which you need to download into their specified directory and it must be the name they provide. So about the create table. My one table would not convert and I could not see why. After looking at the SQL command I saw the problem was the use of DateSerial. I googled a few sites and could not find an answer The CREATE TABLE line was: [RequireUntilDate] datetime2(0) DEFAULT DateSerial(1980,1,1) NOT NULL, I clicked on the whole command and copied it and then in SQL Server Management Studio, I tried to create the table and found that if I specified the date in US date format it worked: [RequireUnti...

Pivot table / cross tab query or transform in SQL and Access

I have been working with and orders database and trying to move away from pivot table forms, since they are a little messy, so started playing with the SQL Transform command, which is how pivot tables are implemented in SQL OR perhaps where the original Pivot tables. The problem I had is the Access only lets you do a Crosstab query with the query wizard on a table or query, and since I was trying to have a faster result I wanted to do just use one query. So I used the main table to create the query (Access automatically displays relation data, so on forms this would be enough) and then one by one I replace the fields with the relational fields I wanted. So my original query looked like this TRANSFORM Sum(OrdersTbl.QuantityOrdered) AS SumOfQuantityOrdered SELECT OrdersTbl.RoastDate, OrdersTbl.CompanyID AS DeliverTo, OrdersTbl.DeliveryById, OrdersTbl.RequiredByDate AS DeliveryDate FROM OrdersTbl WHERE (OrdersTbl.Done=False) GROUP BY OrdersTbl.RoastDate, OrdersTbl.CompanyID, OrdersTbl.Del...

The not so Good food and Wine Show..

I have not gone to the Good Food & Wine Show , for fours years. For many reasons to name a few: The entrance does not include parking, and is mad in price even if you convert to dollars, it is ten dollars to get in. What do you get for that? NOTHING The people on the show have to fork out a small fortune for the having a stand, and this means that fashion food is dominant, because fashion food is more profitable, since more money is spent on brand than product. I am not a huge fan of crowds, studies show over and over again that people in crowds are not people just body moving toward the exit Most exhibitors that make it are only there to supplement their super market mentality. Brand and sales are what drive them there. So why did I go? Well the main reason I went was because I wanted to see Heston Blumenthal, whose programs I have YouTubed and seen on DSTV. Both in search of Perfection, and his Feast series which are mind boggling to say the least. So off we went, decided t...

Visual studio keeps saying "Make sure that the class defined in this code file matches the 'inherits' attribute"

Ever time I built my ASPX c# project the build would give an error saying: "Make sure that the class defined in this code file matches the 'inherits' attribute" I check and it did, I deleted the file and recreated it and still the same problem.The compiler was talking rubbish, and it was delaying me when I was debugging. I copied and pasted the  <%@ Page  tag, and check it. Eventually I though to myself lets think out the box here. It is telling us it does not match, what are the options: The page used to have and _default the definition and somewhere in the project it is finding it (so I did a porject wide search for these, and I did find a few funnies, re built and still same friggin error. The I though lets look for a file that is also referring to the background file, I had copied and pasted a few things, perhaps that was the problem, so I did a search the the full name of the  CodeFile , and that is when I found that another page I had renamed had ...

Help for those looking for Custom Error Handling with ASP.NET

I have been learning about Custom Error pages and ASP.NET websites. The following seem to be a requirement: You need a Global.asax file to catch the error properly and generically, see notes below (#) You need to modify your web.config file It is a good idea to display a user friendly error screen, that at the same time notifies the webmaster somehow Here are a few links that I would recommend reading, and even using their code as a starter: Rich Custom Error Handling with ASP.NET Displaying custom error pages (offical MS site) Advanced Dotnet Tutorial: ASP.NET Custom Error Pages Sure you could have googled them yourself, but I have found a trick when searching for goodies on ASP. Enter in your search query proceeded by MSDN, and you get better results. # Some notes on Gloval.asax To add a Global.asax file to your project. Go to root of the Website, right click -> Add New Item (or menu Website->Add Item) and find the icon that says Global Application Class. Add this it...