Created
August 26, 2013 12:34
-
-
Save felixlindemann/6340977 to your computer and use it in GitHub Desktop.
Translate Access FieldTypes to MYSQL --> Rough Way here - Can be improved!
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" | |
Case 3, 4 | |
str = "int(11)" & IIf(isPK, " AUTO_INCREMENT ", "") | |
Case 6, 7 | |
str = "double" | |
Case 8 | |
str = "datetime" | |
Case 10, 12, 109 | |
str = "longtext" | |
Case Else | |
str = "not supported" | |
End Select | |
getFieldType = str & IIf(isPK, " PRIMARY KEY ", "") | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment