orange,
thanks for your input.
I was under the impression that the CREATETABLE string of DDL type. Either way, my point here is that the CREATETABLE string is not the line of code where fields should be added. Rather, the "base table" is generated first with the barebone essentials (primary key and maybe 1 or 2 other CONSTANT fields).
The reason why creating fields in the CREATETABLE is undesirable to me is based on the following code:
Code:
For i = 1 To tableIt
If cbKeyType.Value = "Pkey NORMAL" Then
db.Execute "CREATE TABLE " & tName & i & "(ID TEXT PRIMARY KEY);"
Else
db.Execute "CREATE TABLE" & tName & i & "(ID AUTOINCREMENT PRIMARY KEY);"
End If
Next i
For i = 1 To tableIt
Set t = db.TableDefs(tName & i)
For k = 1 To iter1.Value
fType = ftype1.Value
Set f1 = t.CreateField(fname1 & k, fType)
Set f2 = t.CreateField("ProcVersion" & k, dbText)
Set f3 = t.CreateField("Rate" & k, dbText)
Set f4 = t.CreateField("Tooling" & k, dbText)
Set f5 = t.CreateField("Resources" & k, dbText)
Set f6 = t.CreateField("Burden" & k, dbText)
Set f7 = t.CreateField("setup" & k, dbText)
Set f8 = t.CreateField("Teardown" & k, dbText)
Set f9 = t.CreateField("Instructions" & k, dbText)
t.Fields.Append f1
t.Fields.Append f2
t.Fields.Append f3
t.Fields.Append f4
t.Fields.Append f5
t.Fields.Append f6
t.Fields.Append f7
t.Fields.Append f8
t.Fields.Append f9
Next k
Next i
Trying to "kill two birds with one stone" in the CREATETABLE method just results in code that is difficult to read. Not to mention, I dont even think I could implement i & k integer variables within the string - with my coding skill it would end up in a lot of frustration.
This also applies to the "ALTER TABLE" DDL string. I don't like the language. The delimeters are spaces requiring one long string. Its just not desirable in my scenario where I am looping.
Regards,