This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 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.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Compare Database | |
Public Sub createMySqlDump2() | |
Dim Filename As String | |
Filename = "Y:\mypath\myfilePrefix-" ' Tablename.sql will be attached | |
createMySqlDump Filename | |
End Sub |