Skip to main content

Posts

Showing posts with the label access

Automatic class or object maker for Access tables in C#

The entity framework is all very well when you run SQL. But what about all of us that are running Access, or are porting old access systems to the web and need to keep legacy systems in place? I was keen to us the object data source to work with data and could not find anything that was able make a class for me. So I wrote my own that listed the tables in the database, then created the class file and stored it in the temp directory. I have a separate code folder to dump these in so that the project does not play with them, rather than dumping them into the App_Code  folder, but you can change this. I placed this code in the test folder of my app which is called  TrackerDotNet So here is the code: First the HTML file <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AutoClassMaker.aspx.cs" Inherits="TrackerDotNet.test.AutoClassMaker" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht...

Free Images to put on buttons or make buttons?

A few cool site for icons that you can use on buttons or as icons, and the are free Find ICONS: Icon Search Engine/a> Icon Finder Icon Archive more here ... Some sites let you donate ;)

Programmatically send email in Access using VBA and Outlook

When I first wrote my early Access system I used a function I setup in Outlook and then I called that. On upgrading I had a few problems with the older method then I found some help on the MSDN website here... and the related video. The first thing to do before starting the code is go into access, access the VBA (press Ctl+G) then click on "Tools" The "References" and then make sure you scroll down to "Microsoft Outlook ..." the version there will be determined by what version you have installed. This the code that I ended up with after looking at the site above Private olApp As Outlook.Application Private olNameSpace As Outlook.NameSpace ' The basics of this from MSDN site ' http://msdn.microsoft.com/en-us/library/ee208547(v=office.12).aspx Private Sub InitOutlook()  ' Initialize a session in Outlook   Set olApp = New Outlook.Application   'Return a reference to the MAPI layer   Set olNameSpace = olApp.GetNamespace("MA...

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