Skip to main content

Posts

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...

Some quick notes on ASP.net and data

Data Binding There are 3 different ways to do data binding within the data view. These can be set as part of the template: <%# Eval(…) %> - Merely writes it out, as is. The is the default when you convert to template <%# Bind(…) %> - Can be used to write it out and can do post it back in the edit scenario, allowing us to update the database <%# XPath(…) %> - used with XML datasource. To supply a XPath string so that we can query the XML to get the data suing an Xpath expression. Example : <%# Eval(“FieldName”) %> The <%# represent a databinding expression, the example above allows you to write out the value of a field that the database has. Sql Data Source A SQL data source has a datasource mode, that you can change. For readonly databases or databases that do not change that often in the asp definition change the DataSourceMode="DataReader" , this will speed up the dataaccess. The reason is that, the da...

VB.NET and C# translation

Found this site when I was looking for a something that I could quickly reference when doing dev tuts that are written in VB and I want to do them in C#. It lists line for line the VB verses the C# code. Not the classes but the declarative stuff, check it out: VB.NET and C# Comparison