-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLCreateTable.cls
More file actions
53 lines (42 loc) · 1.34 KB
/
SQLCreateTable.cls
File metadata and controls
53 lines (42 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "SQLCreateTable"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private meBanco As AcessoBancoGerenciadores
'
'##############################################################################
' PROPRIEDADES
'##############################################################################
'
Public Property Let Banco(ByVal v As AcessoBancoGerenciadores)
meBanco = v
End Property
Public Property Get Banco() As AcessoBancoGerenciadores
Banco = meBanco
End Property
'
'##############################################################################
' MÉTODOS
'##############################################################################
'
Public Function Create(ByVal sTabela As String, ByVal col As SQLColunas) As String
Dim oTipo As SQLTipos
Dim elemento As SQLColuna
Dim sb As StringBuilder
If col Is Nothing Then Exit Function
Set sb = New StringBuilder
Set oTipo = New SQLTipos
oTipo.Banco = meBanco
For Each elemento In col
sb.Add oTipo.ToString(elemento)
Next
Create = "CREATE TABLE " & sTabela & " (" & _
sb.ToDelimitedString(", ") & _
")"
End Function