MySQL to ASP Converter

Transform MySQL database dumps into ASP/VBScript data structures for Classic ASP applications

About MySQL to ASP Converter

Convert MySQL database dumps (CREATE TABLE and INSERT statements) to ASP/VBScript arrays and ADO recordsets. Perfect for migrating database data to Classic ASP applications and legacy systems.

Key Features

  • Multiple Output Formats: Array of arrays (simple) or ADO Recordset (advanced)
  • Smart Parsing: Extracts table structure and data from CREATE TABLE and INSERT statements
  • Column Name Extraction: Preserves column names from database schema
  • Quote Escaping: Properly escapes quotes in VBScript strings
  • ADO Integration: Generates complete ADO Recordset code with usage examples
  • File Upload: Upload .sql files directly
  • Instant Preview: Real-time conversion as you type
  • Copy & Download: Easy export as .asp file

How to Use

  1. Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
  2. Choose Format: Select between simple arrays or ADO Recordset
  3. Review Output: The ASP/VBScript code updates automatically
  4. Copy or Download: Use the Copy or Download button to save your ASP code

Output Formats

Array of Arrays (simple):

' Array of Arrays format
Dim employeesData
employeesData = Array( _
  Array("1", "John Doe", "28", "New York"), _
  Array("2", "Jane Smith", "34", "London") _
)

' Column headers:
' id, name, age, city

ADO Recordset (advanced):

' Create ADO Recordset
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")

' Define fields
rs.Fields.Append "id", adVarChar, 255
rs.Fields.Append "name", adVarChar, 255
rs.Open

' Add records
rs.AddNew
rs("id") = "1"
rs("name") = "John Doe"
rs.Update

rs.MoveFirst

' Usage example:
' Do While Not rs.EOF
'   Response.Write rs("id") & "<br>"
'   rs.MoveNext
' Loop

Supported MySQL Syntax

  • CREATE TABLE: Extracts column names and structure
  • INSERT INTO: Parses data values from INSERT statements
  • Data Types: Handles VARCHAR, INT, DECIMAL, TEXT, DATE, etc.
  • NULL Values: Converts to empty strings in VBScript
  • Quoted Strings: Handles single and double quotes with proper escaping

Common Use Cases

  • Classic ASP Applications: Import database data into legacy ASP apps
  • Data Migration: Convert MySQL dumps to ASP format
  • Testing: Generate test data for ASP applications
  • Prototyping: Quickly create data structures from database schemas
  • Legacy Systems: Maintain older ASP/VBScript applications
  • Offline Data: Create static data arrays for ASP pages

ASP/VBScript Data Structures

  • Arrays: Simple VBScript arrays for basic data storage
  • Recordsets: ADO Recordset objects with full database-like functionality
  • Line Continuation: Uses underscore (_) for multi-line statements
  • String Escaping: Doubles quotes ("") for VBScript string literals

ADO Recordset Features

  • Field Definition: Creates typed fields with Fields.Append
  • Record Management: AddNew, Update, MoveFirst, MoveNext methods
  • Data Access: Access fields by name: rs("fieldname")
  • Iteration: Loop through records with Do While Not rs.EOF
  • Cleanup: Proper resource management with Close and Set Nothing

Tips for Best Results

  • Include both CREATE TABLE and INSERT statements for best column name detection
  • Use Arrays format for simple, lightweight data structures
  • Use ADO Recordset format when you need database-like functionality
  • Test the generated ASP code in your Classic ASP environment
  • Remember to set proper ADO constants (adVarChar, etc.) in your ASP page
  • Use Server.CreateObject for ADO objects in ASP pages
  • Always close and destroy recordsets to prevent memory leaks

ASP/VBScript Compatibility

The generated code works with:

  • Classic ASP: Active Server Pages 2.0, 3.0
  • IIS: Internet Information Services 5.0+
  • VBScript: VBScript 5.0+
  • ADO: ActiveX Data Objects 2.0+
  • Windows Server: All versions supporting IIS and ASP

FAQ

  • Do I need ADO installed on the server for the Recordset format?

    Yes. The Recordset output assumes that ADO is available on the IIS server. If you do not have ADO, use the Array of Arrays format instead.

  • Can I change the recordset cursor type or lock type?

    The generated snippet uses the default ADO settings. After copying the code, you can configure cursor and lock options on the recordset as needed.

  • How are NULL values handled in ASP?

    NULLs are converted to empty strings in the VBScript output. You can adjust the behavior by post-processing the generated code if you need a different representation.

  • Can I use this output with ASP.NET?

    The tool targets Classic ASP (VBScript). For ASP.NET, you would typically use C# or VB.NET and different data structures, so you may need to adapt the output manually.

  • Is any of my SQL data sent over the network?

    No. Everything runs locally in your browser, and no data is uploaded to a server.

Privacy & Security

All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.