Hi, thanks in advance, I want to create a table of my current dbf that contains
1 the table name
2 fields within the table
3 Field Size, format, input mast caption etc. all the filed information.
The reason is becase I am creating an upgrade to a product that has many versions. I want to level the versions I. I need to know what tables need updating and which ones dont. any suggestions: I have a routine I got off this site? (i think) that give me table name and fields but nothing else
Function BuildTableNamesList()
Dim strSql As String
Dim strName As String
Dim strFSql As String
Dim strField As String
Dim tjDb As DAO.Database
Dim tjTab As DAO.TableDef
Dim tjfld As DAO.Field
strSql = "insert into tbl_tableList (t_name) values( " & "'" & strName & "');"
' strFSql = "insert into tbl_FieldsList(t_key, f_name) values ( " & "'" & numKey & "'" & "'" & strField & "');"
Set tjDb = CurrentDb
For Each tjTab In tjDb.TableDefs
If (tjTab.Attributes And dbSystemObject) = 0 Then
strName = tjTab.NAME
If strName <> "tbl_TableList" Or strName <> "tbl_FieldsList" Then
strSql = "insert into tbl_tableList (t_name) values ( " & "'" & strName & "');"
DoCmd.RunSQL (strSql)
For Each tjfld In tjTab.Fields
strField = tjfld.NAME
strFSql = "Insert into tbl_FieldsList (f_file, f_name) values (" & "'" & strName & "'," & "'" & [strField] & "');"
DoCmd.RunSQL (strFSql)
Next
End If
End If
Next
tjDb.Close
Set tjTab = Nothing
Set tjDb = Nothing
End Function
Im not sure what else to add to get the individul field information.
Thanks
Jim
1 the table name
2 fields within the table
3 Field Size, format, input mast caption etc. all the filed information.
The reason is becase I am creating an upgrade to a product that has many versions. I want to level the versions I. I need to know what tables need updating and which ones dont. any suggestions: I have a routine I got off this site? (i think) that give me table name and fields but nothing else
Function BuildTableNamesList()
Dim strSql As String
Dim strName As String
Dim strFSql As String
Dim strField As String
Dim tjDb As DAO.Database
Dim tjTab As DAO.TableDef
Dim tjfld As DAO.Field
strSql = "insert into tbl_tableList (t_name) values( " & "'" & strName & "');"
' strFSql = "insert into tbl_FieldsList(t_key, f_name) values ( " & "'" & numKey & "'" & "'" & strField & "');"
Set tjDb = CurrentDb
For Each tjTab In tjDb.TableDefs
If (tjTab.Attributes And dbSystemObject) = 0 Then
strName = tjTab.NAME
If strName <> "tbl_TableList" Or strName <> "tbl_FieldsList" Then
strSql = "insert into tbl_tableList (t_name) values ( " & "'" & strName & "');"
DoCmd.RunSQL (strSql)
For Each tjfld In tjTab.Fields
strField = tjfld.NAME
strFSql = "Insert into tbl_FieldsList (f_file, f_name) values (" & "'" & strName & "'," & "'" & [strField] & "');"
DoCmd.RunSQL (strFSql)
Next
End If
End If
Next
tjDb.Close
Set tjTab = Nothing
Set tjDb = Nothing
End Function
Im not sure what else to add to get the individul field information.
Thanks
Jim