- Strip emojis from 47 markdown files across docs/, sql/, and root - Add docs/DOCS_CONSOLIDATION_PLAN.md with plan to reduce 45 docs to 8 - Establish no-emoji rule for documentation going forward 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
14 KiB
Classic ASP/VBScript Development Guide
Overview
shopdb is a Classic ASP application using VBScript running on IIS Express in Windows 11 VM.
- Language: VBScript (Classic ASP)
- Server: IIS Express (Windows 11 VM)
- Database: MySQL 5.6 (Docker container on Linux host)
- Development: Edit files on Linux with Claude Code, test on Windows/IIS
Project Setup
Location
- Linux:
~/projects/windows/shopdb/ - Windows:
Z:\shopdb\ - IIS Config: Points to
Z:\shopdb\
Database Connection
<%
' Connection string for shopdb
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Driver={MySQL ODBC 8.0 Driver};" & _
"Server=192.168.122.1;" & _
"Port=3306;" & _
"Database=shopdb;" & _
"User=570005354;" & _
"Password=570005354;" & _
"Option=3;"
conn.Open
' Use the connection
' ... your code here ...
conn.Close
Set conn = Nothing
%>
Database Credentials
Production Database: shopdb
- Host (from Windows): 192.168.122.1
- Port: 3306
- Database: shopdb
- User: 570005354
- Password: 570005354
Prerequisites in Windows VM
Required Software
-
MySQL ODBC 8.0 Driver
- Download: https://dev.mysql.com/downloads/connector/odbc/
- Install 64-bit version
- Used by Classic ASP to connect to MySQL
-
IIS Express
- Already installed
- Location:
C:\Program Files\IIS Express\
Windows Configuration
- Z: Drive mapped to
\\192.168.122.1\windows-projects - Firewall allows port 8080 inbound
- URL ACL configured:
netsh http add urlacl url=http://*:8080/ user="Everyone"
Auto-Start IIS Express on Windows Boot
To automatically start IIS Express when Windows boots:
-
In Windows, open Task Scheduler (search for "Task Scheduler")
-
Create a new task:
-
Click "Create Task..." (not "Create Basic Task")
-
General tab:
- Name:
Start IIS Express - shopdb - Description:
Auto-start IIS Express for shopdb site - Check "Run with highest privileges"
- Check "Run whether user is logged on or not"
- Configure for: Windows 10/11
- Name:
-
Triggers tab:
- Click "New..."
- Begin the task: "At startup"
- Delay task for: 30 seconds (gives network time to connect)
- Click OK
-
Actions tab:
- Click "New..."
- Action: "Start a program"
- Program/script:
wscript.exe - Add arguments:
Z:\start-iis-shopdb.vbs - Click OK
-
Conditions tab:
- Uncheck "Start the task only if the computer is on AC power"
- Check "Wake the computer to run this task" (optional)
-
Settings tab:
- Check "Allow task to be run on demand"
- Check "Run task as soon as possible after a scheduled start is missed"
- If the task is already running: "Do not start a new instance"
-
Click OK to save
-
-
Test the task:
- Right-click the task in Task Scheduler
- Click "Run"
- Check http://localhost:8080 in browser
- Should see shopdb running
-
Verify on next boot:
- Restart Windows VM
- Wait 30 seconds after login
- Check http://192.168.122.151:8080 from Linux
- IIS Express should be running automatically
Files Created:
Z:\start-iis-shopdb.bat- Batch file to start IIS ExpressZ:\start-iis-shopdb.vbs- VBScript wrapper (runs silently, no console window)
Manual Start (if needed):
# In Windows, double-click:
Z:\start-iis-shopdb.vbs
# Or run from PowerShell:
wscript.exe Z:\start-iis-shopdb.vbs
Development Workflow
1. Edit Code on Linux
# Navigate to project
cd ~/projects/windows/shopdb
# Start Claude Code
claude
# Ask Claude to help with your ASP/VBScript code
# Example: "Create a VBScript function to query the database and display results"
2. Files Auto-Sync to Windows
- Any changes saved on Linux automatically appear in Windows at
Z:\shopdb\ - No manual copying needed thanks to Samba share
3. Test on IIS Express
In Windows PowerShell (as Administrator or with URL ACL):
cd "C:\Program Files\IIS Express"
.\iisexpress.exe /site:shopdb
Access from Linux:
- Browser: http://192.168.122.151:8080
Access from Windows:
- Browser: http://localhost:8080
4. Iterate
- Edit on Linux with Claude
- Refresh browser to see changes
- Debug and repeat
Common VBScript/ASP Patterns
Database Query (SELECT)
<%
Dim conn, rs, sql
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "Driver={MySQL ODBC 8.0 Driver};Server=192.168.122.1;Port=3306;Database=shopdb;User=570005354;Password=570005354;"
conn.Open
sql = "SELECT * FROM products WHERE category = ?"
rs.Open sql, conn
Do While Not rs.EOF
Response.Write rs("product_name") & "<br>"
rs.MoveNext
Loop
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
%>
Database Insert
<%
Dim conn, sql
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Driver={MySQL ODBC 8.0 Driver};Server=192.168.122.1;Port=3306;Database=shopdb;User=570005354;Password=570005354;"
conn.Open
sql = "INSERT INTO orders (customer_id, order_date, total) VALUES (1, NOW(), 99.99)"
conn.Execute sql
conn.Close
Set conn = Nothing
Response.Write "Order inserted successfully"
%>
Database Update
<%
Dim conn, sql, orderId
orderId = Request.Form("order_id")
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Driver={MySQL ODBC 8.0 Driver};Server=192.168.122.1;Port=3306;Database=shopdb;User=570005354;Password=570005354;"
conn.Open
sql = "UPDATE orders SET status = 'completed' WHERE order_id = " & orderId
conn.Execute sql
conn.Close
Set conn = Nothing
Response.Redirect "orders.asp"
%>
Form Handling
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
' Handle form submission
Dim name, email
name = Request.Form("name")
email = Request.Form("email")
' Validate and process
' ...
Response.Write "Form submitted successfully"
Else
' Display form
%>
<form method="post" action="submit.asp">
<input type="text" name="name" required>
<input type="email" name="email" required>
<button type="submit">Submit</button>
</form>
<%
End If
%>
Include Files
<!-- #include file="config.asp" -->
<!-- #include file="header.asp" -->
<% ' Your page content here %>
<!-- #include file="footer.asp" -->
Session Management
<%
' Set session variable
Session("user_id") = 123
Session("username") = "admin"
' Get session variable
If Session("user_id") <> "" Then
Response.Write "Welcome, " & Session("username")
Else
Response.Redirect "login.asp"
End If
' Clear session
Session.Abandon
%>
Connection File Template
Create: ~/projects/windows/shopdb/includes/db_connection.asp
<%
' Database connection configuration
Function GetConnection()
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Driver={MySQL ODBC 8.0 Driver};" & _
"Server=192.168.122.1;" & _
"Port=3306;" & _
"Database=shopdb;" & _
"User=570005354;" & _
"Password=570005354;" & _
"Option=3;"
On Error Resume Next
conn.Open
If Err.Number <> 0 Then
Response.Write "Database connection failed: " & Err.Description
Response.End
End If
Set GetConnection = conn
End Function
%>
Usage in other files:
<!-- #include file="includes/db_connection.asp" -->
<%
Dim conn
Set conn = GetConnection()
' Use the connection
' ...
conn.Close
Set conn = Nothing
%>
Testing Database Connection
Create: ~/projects/windows/shopdb/test_connection.asp
<%@ Language=VBScript %>
<html>
<head>
<title>Database Connection Test</title>
</head>
<body>
<h1>MySQL Connection Test</h1>
<%
On Error Resume Next
Dim conn, rs
Set conn = Server.CreateObject("ADODB.Connection")
Response.Write "<p>Attempting to connect to shopdb...</p>"
conn.ConnectionString = "Driver={MySQL ODBC 8.0 Driver};" & _
"Server=192.168.122.1;" & _
"Port=3306;" & _
"Database=shopdb;" & _
"User=570005354;" & _
"Password=570005354;"
conn.Open
If Err.Number <> 0 Then
Response.Write "<p style='color:red;'><strong>Connection Failed!</strong></p>"
Response.Write "<p>Error: " & Err.Description & "</p>"
Else
Response.Write "<p style='color:green;'><strong>Connection Successful!</strong></p>"
' Test query
Set rs = conn.Execute("SELECT VERSION() as version, DATABASE() as db")
Response.Write "<p>MySQL Version: " & rs("version") & "</p>"
Response.Write "<p>Current Database: " & rs("db") & "</p>"
rs.Close
Set rs = Nothing
conn.Close
End If
Set conn = Nothing
%>
</body>
</html>
Troubleshooting
Can't Connect to MySQL
Check from Windows PowerShell:
# Test network connectivity
Test-NetConnection -ComputerName 192.168.122.1 -Port 3306
# Should show: TcpTestSucceeded : True
Check MySQL is running on Linux:
docker ps | grep mysql
docker compose logs mysql
ODBC Driver Not Found
Error: [Microsoft][ODBC Driver Manager] Data source name not found
Solution:
- Install MySQL ODBC 8.0 Driver in Windows
- Verify in Control Panel → Administrative Tools → ODBC Data Sources
- Check driver name matches in connection string
Permission Denied
Error: Access denied for user '570005354'
Solution on Linux:
# Re-grant permissions
docker exec -it dev-mysql mysql -u root -prootpassword -e "
GRANT ALL PRIVILEGES ON shopdb.* TO '570005354'@'%' IDENTIFIED BY '570005354';
FLUSH PRIVILEGES;
"
IIS Express Won't Start
Check:
- Another process using port 8080? Check Task Manager
- URL ACL configured? Run as Admin or check:
netsh http show urlacl - applicationhost.config correct? Check binding:
*:8080:*
Changes Not Appearing
Solutions:
- Hard refresh browser:
Ctrl + F5 - Clear browser cache
- Check file actually saved on Linux:
ls -la ~/projects/windows/shopdb/ - Check Samba:
sudo systemctl status smbd
MySQL 5.6 Limitations
Our MySQL version (5.6) doesn't support:
- JSON data type (use TEXT and parse)
CREATE USER IF NOT EXISTSsyntax- Some newer functions
User management in MySQL 5.6:
-- Create/update user
GRANT ALL PRIVILEGES ON shopdb.* TO 'username'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
Security Notes
Development Environment Only
These credentials are for DEVELOPMENT:
- User: 570005354
- Password: 570005354
For Production:
- Use strong, unique passwords
- Implement proper authentication
- Use SSL/TLS connections
- Restrict database access by IP
- Never commit credentials to Git
Quick Commands Reference
Start Development
# On Linux
~/start-dev-env.sh
# In Windows
cd "C:\Program Files\IIS Express"
.\iisexpress.exe /site:shopdb
# Open browser to: http://192.168.122.151:8080
Edit Code
# On Linux
cd ~/projects/windows/shopdb
claude
Check Database
# On Linux
docker exec -it dev-mysql mysql -u 570005354 -p570005354 shopdb
Backup Database
# On Linux
docker exec dev-mysql mysqldump -u 570005354 -p570005354 shopdb > ~/backups/shopdb-$(date +%Y%m%d).sql
Restore Database
# On Linux
docker exec -i dev-mysql mysql -u 570005354 -p570005354 shopdb < backup.sql
Using Claude Code for ASP/VBScript
Good Prompts:
"Create a VBScript function to display all products from the database in an HTML table"
"Add error handling to this database query in Classic ASP"
"Create a login form in Classic ASP that checks credentials against the users table"
"Write VBScript code to handle a POST form submission and insert into database"
"Create a pagination system for displaying database results in Classic ASP"
Be Specific:
"I'm using Classic ASP with VBScript and MySQL 5.6. Create a page that..."
Starting a Claude Code Session
When beginning work, tell Claude to "start up" or "let's start the dev environment". Claude will automatically:
- Review all .md documentation files
- Run
~/start-dev-env.shto start Docker containers and Windows VM - Check service status to ensure everything is running
- Load the todo list to continue from where you left off
Closing Out a Claude Code Session
When you're done working, tell Claude to "close out" or "we're closing out for now". Claude will automatically:
- Update and consolidate the todo list with completed work
- Mark completed phases/tasks
- Run
~/stop-dev-env.shto properly shutdown the environment - Update relevant documentation
This ensures your development environment is properly shut down and all progress is tracked.
Project Structure Example
shopdb/
├── index.asp # Homepage
├── test_connection.asp # Database test page
├── includes/
│ ├── db_connection.asp # Database connection function
│ ├── header.asp # Common header
│ └── footer.asp # Common footer
├── admin/
│ ├── login.asp # Admin login
│ └── dashboard.asp # Admin dashboard
├── css/
│ └── styles.css # Stylesheets
├── js/
│ └── scripts.js # JavaScript files
└── images/
└── logo.png # Images
Additional Notes
- No PHP on Windows - PHP development is done via Docker/Nginx on Linux (port 8080)
- ASP on Windows only - Classic ASP runs on IIS Express in Windows VM
- Database shared - Both PHP (Docker) and ASP (Windows) can access the same MySQL
- File editing - Always edit on Linux with Claude Code, files sync automatically to Windows
Technology Stack Summary:
- Classic ASP with VBScript
- IIS Express on Windows 11
- MySQL 5.6 (Docker/Linux)
- Samba for file sharing
- Claude Code for development assistance