Saturday, 11 December 2010

Visual Basic Woes

I've decided to have a real go at mastering Visual Basic 2010. After years of playing with VBA I'd like to be able to write real standalone apps without needing Access as a rather expensive front end. I'm going to post here any issues I've found with getting a "proper" app written.

Starting from scratch with a new laptop  (Windows 7 Home Premium) I downloaded (free) all this:

Visual Basic .net 2010 Express
SQL Server 2008 R2 Express x64
Office 2007 Home & Student (I had a spare license)
Adventureworks sample database
VB sample code

I needed to import data from an Access app on another laptop, so decided to use an Excel backup of the tables. Problem #1. The app is a genealogy database and has dates going back to the C17th. Excel won't accept a date before 1901. Had to write queries to export dates as text strings.

Then, Problem #2 (you won't believe it) there's no Excel 2007 connector for SQL Server 2008 x64.
Official MS advice was to install the x86 (32 bit) version and the downloadable Access connector, then reference the data across to the x64 database. So I did that. and then

Problem #3, I can't see any way to establish a data connection to a SQL server database from Visual Studiio. I can connect to a database file (.sdf) but not to a database in a server instance, which is what I am used to working with in SQL Server. So I'll investigate a bit more, and then probably copy the data over to a .sdf file.

No comments: