Skip to content

Instantly share code, notes, and snippets.

Option Compare Database
Public Sub createMySqlDump2()
Dim Filename As String
Filename = "Y:\mypath\myfilePrefix-" ' Tablename.sql will be attached
createMySqlDump Filename
End Sub
@felixlindemann
felixlindemann / migrateAccessToMYsql_C.vba
Created August 26, 2013 12:34
Translate Access FieldTypes to MYSQL --> Rough Way here - Can be improved!
' translate access dbtypes to mysql types --> Rough way here.
Private Function getFieldType(value As Integer, Optional isPK As Boolean = False) As String
' compare to http://allenbrowne.com/ser-49.html
Dim str As String
str = ""
Select Case value
Case 1
str = "Boolean"
@felixlindemann
felixlindemann / migrateAccessToMYsql_B.vba
Created August 26, 2013 12:34
Correct Values MySQL doesn't understand due to encoding issues
' Correct values, mysql doesn't understand due to encoding issuses
Private Function cleanValue(value As String) As String
value = IIf(IsNull(value) Or value = "", 0, value)
value = Replace(value, "%", " percent ")
value = Replace(value, "‰", "permill")
value = Replace(value, "'", "")
value = Replace(value, "°", "deg")
value = Replace(value, ">=", "geq.")
@felixlindemann
felixlindemann / migrateAccessToMYsql_A.vba
Created August 26, 2013 12:33
Create MySQL Dump from Access DB
Public Sub createMySqlDump(Filename As String)
' Declaration of Variables
Dim j As Integer
Dim k As Integer
Dim SQL As String
Dim SQL_INSERT As String