Hello!
While writing a class that would be able to comfortably convert and edit databases, I asked myself if I should get the SQLite database structure by
Version 1:
or byCode:"SELECT * FROM tablename LIMIT 0"
'Version 2:
or byCode:"SELECT * FROM dbname.sqlite_master""
Version 3:
I am asking this here now because I noticed that the order in which fields are returned by "SELECT * FROM..." differs from the order that Table.Column has.Code:Dim DB As cDataBase For Each DB In uCn.DataBases DB.ReScanSchemaInfo 'Seems necessary if a table has just been created and the connection had not been closed ye If VBA.LCase(DB.Name) = VBA.LCase(uDBName) Then Dim tbl As cTable For Each tbl In DB.Tables If LCase(tbl.Name) = LCase(uTableName) Then TableExists = True Exit Function End If Next tbl End If Next DB
Why this is of importance:
A cRecordset however has cFields.cField.ColumnType which is FieldType
However, a cColumn does not have the cField.ColumnType.Code:cFields.cField.ColumnType cFields.cField.OriginalDataType cFields.cField.IndexInFieldList As Long
Instead it has a string value:
I dare to ask this as I have spent much time on that already, and I compared with some apps doing sqlite conversions, and I noticed that it's a broard topic.Code:cTables.cTable.cColumns.cColumn.ColumnType (String)
I wonder what I should rely on in order to get away with the least conversions and iterations possible. I only need the RC6 definitions, I think, and that is why I wonder why cColumn is of type String. Was that to leave future additions open?
Thank you!


Reply With Quote
