โโโ โโโโโโโโโโ โโโโโโโ โโโโโโโโโ โโโโโโโ โโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโ
โโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโ
โโโ โโโโโโโโโโโโโโโโโโโ โโโ โโโ โโโ โโโโโโ โโโโโโโโโ โโโ โโโโโโโโ
โโโโ โโโโโโโโโโโโโโโโโโโโโ โโโ โโโ โโโ โโโโโโโโโโโโโโโโ โโโ โโโโโโโ
โโโโโโโ โโโโโโโโโโโโโโโโโ โโโ โโโโโโโโโ โโโ โโโโโโโโโโโโโโ โโโ โโโโโโโ
โโโโโ โโโโโโโ โโโโโโโ โโโ โโโโโโโ โโโ โโโโโโโโโโโโโ โโโ โโโโโโ
Welcome to the time machine! ๐ฐ๏ธโจ
Remember when Visual Basic 6 was the king of RAD (Rapid Application Development)? When you could drag-drop an ActiveX control and ship enterprise software faster than dial-up could connect? When On Error Resume Next was... well, let's not talk about that. ๐
This lab takes you on a radical journey from the golden age of Windows 98 to the modern cloud era! You'll modernize a real-world VB6 manufacturing application that's been running shop floor operations since 2001. We're talking MSFlexGrid, ADO Recordsets, Crystal Reports, and enough global variables to make your head spin! ๐ช๏ธ
Business Domain: Precision Parts Manufacturing ๐ญ
A small manufacturing company's inventory and work order tracking system. It manages raw materials, production orders, quality inspections, and shipping โ all from a trusty VB6 desktop app connected to an Access database on a network share. Classic! ๐ช
๐ฅ Assess VB6 applications for modernization scope and complexity
๐ฅ Migrate Microsoft Access databases to SQL Server / Azure SQL
๐ฅ Translate VB6 forms and business logic to modern C# patterns
๐ฅ Eliminate global state with dependency injection (goodbye modGlobals.bas!)
๐ฅ Choose between desktop (WPF) and web (Blazor) modernization targets
๐ฅ Replace ActiveX controls with modern equivalents
๐ฅ Transform Crystal Reports into QuestPDF masterpieces
๐ฅ Deploy to Azure App Service (Blazor) or MSIX packages (WPF)
Required Software:
- โ .NET 9 SDK (Download)
- โ Visual Studio 2022 (or VS Code with C# Dev Kit)
- โ SQL Server LocalDB or Azure SQL Database
- โ Azure subscription (for web deployment option)
- โ Git & GitHub CLI
Knowledge Requirements:
- ๐ Basic VB6 reading knowledge (no VB6 IDE needed!)
- ๐ C# and .NET experience
- ๐ Entity Framework Core fundamentals
- ๐ Blazor or WPF experience (depending on your chosen path)
Optional Retro Gear:
- ๐ง 90s synthwave playlist (for authentic vibes)
- ๐ฅ๏ธ Windows 98 screensaver (just kidding... or are we?)
# Clone the repo
git clone https://github.com/EmeaAppGbb/appmodlab-vb6-to-dotnet9.git
cd appmodlab-vb6-to-dotnet9
# Checkout the legacy branch to explore VB6 goodness
git checkout legacy
# Check out the step-by-step branches
git branch -r๐ฎ MSGBOX: "Choose Your Adventure!" ๐ฎ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Press [W] for WPF Desktop Path โ
โ Press [B] for Blazor Web Path โ
โ โ
โ [ W ] [ B ] [ Cancel ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
PrecisionParts/
โโโ ๐๏ธ Forms/ # VB6 Forms (*.frm)
โ โโโ frmMain.frm # MDI parent with menu bar
โ โโโ frmInventory.frm # Raw material inventory grid
โ โโโ frmWorkOrder.frm # Work order entry/editing
โ โโโ frmQualityCheck.frm # QC inspection form
โ โโโ frmShipping.frm # Shipping manifest
โ โโโ frmPartLookup.frm # Part number search dialog
โ โโโ frmReports.frm # Report selection and preview
โ โโโ frmLogin.frm # Simple login form
โ
โโโ ๐ฆ Modules/ # Global modules (*.bas)
โ โโโ modDatabase.bas # ADO connection & helpers
โ โโโ modGlobals.bas # 50+ global variables ๐ฑ
โ โโโ modPrinting.bas # Windows API printer magic
โ โโโ modUtilities.bas # String/date/number utils
โ
โโโ ๐๏ธ Classes/ # VB6 Classes (*.cls)
โ โโโ clsWorkOrder.cls # Work order business logic
โ โโโ clsInventory.cls # Inventory calculations
โ โโโ clsPart.cls # Part number validation
โ
โโโ ๐ Reports/ # Crystal Reports (*.rpt)
โ โโโ rptWorkOrder.rpt # Work order printout
โ โโโ rptShippingLabel.rpt # Shipping label template
โ โโโ rptInventoryStatus.rpt # Inventory status report
โ
โโโ ๐พ Database/
โ โโโ PrecisionParts.mdb # Access 2003 database
โ
โโโ ๐จ Resources/
โโโ icons/ # Toolbar icons (BMP format!)
Language & Runtime:
- ๐น Visual Basic 6 SP6
- ๐ช Windows Common Controls 6.0
- ๐ ActiveX Components (OCX files galore!)
Data Access Layer:
- ๐ก ADO 2.8 (ADODB.Connection, ADODB.Recordset)
- ๐พ Microsoft Access 2003 (MDB file on network share)
- ๐ File-locking for concurrent access (oh boy!)
UI Controls:
- ๐ MSFlexGrid โ The grid to rule them all
- ๐๏ธ CommonDialog โ File picker supreme
- ๐ฑ๏ธ Windows Common Controls โ Toolbar, StatusBar, TreeView
Reporting:
- ๐ Crystal Reports 8.5 (unsupported vintage edition)
System Integration:
- ๐งฐ Windows API Calls (user32.dll, kernel32.dll)
- ๐ Registry Settings (SaveSetting/GetSetting)
Database Schema:
Tables: Parts, RawMaterials, WorkOrders, QualityChecks,
ShippingManifests, Customers, Users
๐จ Global Variable Overload โ modGlobals.bas with 50+ public variables
๐จ GoTo Error Handling โ On Error GoTo ErrHandler everywhere
๐จ Network Share Database โ Access MDB with file locking
๐จ Plain Text Passwords โ Yes, really
๐จ Hardcoded Paths โ File paths and connection strings everywhere
๐จ DoEvents Hell โ Keeping UI responsive the old-school way
๐จ No Unit Tests โ Testing was for the weak! (jk, please test)
Option A: Desktop Modernization (WPF)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ .NET 9 WPF Application โ
โ โโ MVVM Pattern โ
โ โโ WPF DataGrid (goodbye MSFlexGrid!) โ
โ โโ Dependency Injection โ
โ โโ Windows Authentication โ
โ โโ MSIX Deployment โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Option B: Web Modernization (Blazor Server)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ .NET 9 Blazor Server Application โ
โ โโ Component-based UI โ
โ โโ SignalR Real-time Updates โ
โ โโ ASP.NET Core Identity โ
โ โโ Responsive Design โ
โ โโ Azure App Service Deployment โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Framework:
- โก .NET 9 โ The latest and greatest!
- ๐๏ธ C# 13 โ Modern, safe, and fast
Data Access:
- ๐๏ธ Entity Framework Core 9 โ No more ADO Recordsets!
- ๐ Repository Pattern โ Clean separation of concerns
- ๐ Azure SQL Database โ Cloud-scale data storage
Reporting:
- ๐ QuestPDF โ Beautiful PDF generation in C#
Configuration:
- โ๏ธ appsettings.json โ Goodbye registry!
- ๐ง Azure App Configuration (optional) โ Centralized config
Authentication:
- ๐ ASP.NET Core Identity (Blazor) โ Real security!
- ๐ช Windows Authentication (WPF) โ Domain integration
Deployment:
- โ๏ธ Azure App Service (Blazor path)
- ๐ฆ MSIX Packaging (WPF path)
# Checkout the legacy branch
git checkout legacy
# Use Copilot CLI to explore the VB6 source
gh copilot explain "What does this VB6 code do?" --file Forms/frmMain.frmWhat to Look For:
- Global state management patterns
- Database access patterns (ADO Recordsets)
- ActiveX control usage
- Business logic location (forms vs. classes)
SETUP WIZARD ๐งโโ๏ธ โ Database Migration
# Checkout the database migration branch
git checkout step-1-database-migration
# Review migration scripts
ls Database/Migration/
# Run the migration with Copilot CLI assistance
gh copilot suggest "Create an Azure SQL Database and run migration scripts"Migration Tasks:
- Convert Access MDB schema to SQL Server
- Migrate seed data (100+ parts, 50+ work orders)
- Add proper indexes and constraints
- Update password storage (bcrypt hashing!)
# Checkout the domain model branch
git checkout step-2-domain-model
# Explore EF Core entities
gh copilot explain "Show me the EF Core entity mapping for the Parts table"What's Happening:
- ADO Recordsets โ EF Core Entities
- Global variables โ Dependency Injection services
- VB6 classes โ C# domain models with proper encapsulation
MSGBOX: "Choose Your Path!" โ
# For Blazor path:
git checkout step-3-ui-migration
# For WPF path:
git checkout solution-wpfUI Transformation:
- MDI Forms โ Blazor Components / WPF Views
- MSFlexGrid โ Blazor Tables / WPF DataGrid
- CommonDialog โ Modern file pickers
# Work through each form migration
gh copilot suggest "Convert this VB6 form to a Blazor component"Form-by-Form Journey:
- ๐ frmMain โ MainLayout/Shell
- ๐ฆ frmInventory โ Inventory Component/View
- ๐ frmWorkOrder โ WorkOrder Component/View
- โ frmQualityCheck โ QualityCheck Component/View
- ๐ฎ frmShipping โ Shipping Component/View
- ๐ frmPartLookup โ PartLookup Dialog/Modal
- ๐ frmReports โ Reports Component/View
- ๐ frmLogin โ Login Component/View
# Checkout the reporting branch
git checkout step-4-reports-and-printing
# Explore QuestPDF templates
gh copilot explain "How does QuestPDF replace Crystal Reports?"Crystal โ QuestPDF:
- Work order printouts โ QuestPDF documents
- Shipping labels โ QuestPDF templates
- Inventory reports โ QuestPDF with charts
SETUP WIZARD ๐งโโ๏ธ โ Security Upgrade
# Configure ASP.NET Core Identity
gh copilot suggest "Set up ASP.NET Core Identity with role-based authorization"Security Wins:
- Plain text passwords โ Hashed with bcrypt
- File-based auth โ Database-backed identity
- No roles โ Role-based access control (Admin, Operator, Inspector)
# Checkout deployment branch
git checkout step-5-deploy
# Review Bicep templates
ls Infrastructure/
# Deploy with Copilot CLI
gh copilot suggest "Deploy Blazor app to Azure App Service with CI/CD"Deployment Stack:
- ๐ Azure App Service (Blazor)
- ๐๏ธ Azure SQL Database
- ๐ฆ Azure Blob Storage (file attachments)
- ๐ GitHub Actions (CI/CD)
Estimated Time: 5โ7 hours โฐ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Step 1: Analyze Legacy (1 hr) โ
โ Step 2: Database Migration (1 hr) โ
โ Step 3: Domain Model (1 hr) โ
โ Step 4: UI Shell (1 hr) โ
โ Step 5: Form Migration (2 hrs) โ
โ Step 6: Reports (1 hr) โ
โ Step 7: Authentication (30 min) โ
โ Step 8: Deploy (30 min) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ก Pro Tip: Use GitHub Copilot CLI throughout to speed up code translation and debugging!
Microsoft Docs:
- .NET 9 Documentation
- Blazor Documentation
- WPF Documentation
- Entity Framework Core 9
- QuestPDF Documentation
Migration Guides:
Azure Resources:
- GitHub Copilot CLI โ Your AI pair programmer
- Visual Studio 2022 โ Premium IDE experience
- Azure Data Studio โ Database management
- SSMA for Access โ Automated database migration
๐ main # Complete lab documentation
๐ legacy # VB6 source + compiled EXE
๐ solution # Blazor implementation
๐ solution-wpf # WPF implementation
๐ step-1-database-migration # Access โ SQL Server
๐ step-2-domain-model # EF Core entities
๐ step-3-ui-migration # UI framework setup
๐ step-4-reports-and-printing # QuestPDF implementation
๐ step-5-deploy # Azure deployment
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ ๐ CONGRATULATIONS! ๐ โ
โ โ
โ You've successfully modernized a VB6 app โ
โ to .NET 9! From ActiveX to Azure, โ
โ from Access to SQL Server, โ
โ from Windows 98 vibes to Cloud Native glory! โ
โ โ
โ ๐ Achievement Unlocked: โ
โ "Retro Modernizer" ๐ โ
โ โ
โ [ OK ] โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Found a bug? Want to add more retro flair? PRs welcome! ๐
- Fork the repo
- Create your feature branch (
git checkout -b feature/more-synthwave) - Commit your changes (
git commit -m 'โจ Add more neon') - Push to the branch (
git push origin feature/more-synthwave) - Open a Pull Request
This project is licensed under the MIT License.
- ๐ VB6 Community โ For keeping the legacy alive
- ๐ Microsoft โ For .NET 9 and the amazing evolution
- ๐ฎ Synthwave Producers โ For the perfect coding soundtrack
- ๐ญ Manufacturing Teams โ Still running VB6 in production!







