Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Posts
    5

    Unanswered: MS Example Programatically Creating Schema.ini

    Hi,

    I'm using a modified version of MS's example :
    ACC2000: How to Programmatically Create a Schema.ini File
    http://support.microsoft.com/?kbid=210001

    I've modified it to work with ADOX, since I couldnt get it to work as was... and I already had a working app which enumerates tables and fields.

    Problem:

    The resulting Schema.ini looks great except for one major problem. When I enumerate through the .Columns collection it is NOT listing them in the order they are defined in the table, but is instead enumerating them alphabetically.

    Any ideas how I can get them listed in the order they truly appear?

    (If you have ideas on how to suck import specs out from a .mdb I'd love the info as well)

    Thanks
    Brad


    Incase its of interest:

    Dim cat As ADOX.Catalog
    Dim tbl As ADOX.Table


    Set tbl = cat.Tables(sTblQryName)
    With tbl
    For i = 0 To tbl.Columns.Count - 1
    With tbl.Columns(i)
    fldName = .Name

  2. #2
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    1.

    you can use ADO...

    Dim myRecSet As New ADODB.Recordset

    ' this is Access2k method, you can use any connection string
    myRecSet.Open "SELECT * FROM myTable", CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly

    For i = 0 To myRecSet.Fields.Count - 1
    Debug.Print myRecSet.Fields(i).Name
    Next

    myRecSet.Close


    or DAO....

    For i = 0 To CurrentDb.TableDefs("myTable").Fields.Count - 1
    Debug.Print CurrentDb.TableDefs("myTable").Fields(i).Name
    Next



    2.

    try to use schema.ini for SPECIFICATION ....

    http://support.microsoft.com/default...;en-us;q149090




    jiri

  3. #3
    Join Date
    Feb 2003
    Posts
    5
    2.

    try to use schema.ini for SPECIFICATION ....

    Thats exactly what Im trying to do. Save the table specs! (or if I can find a way, the import export spec which I used to originally import the tables).

  4. #4
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    there is no super documentation for that, but you can play with HIDDEN tables (you can unhide them tool-options tab VIEW)

    MSysIMEXColumns 9includes info about columns for each SPEC)
    MSysIMEXSpecs (include info about SPECS)


    if you want just to copy ALL SPECS between two MDBs, go to FILE-GET EXTERNAL DATA-IMPORT select MDB and click on OPTIONS and select Import/Export Specs).



    jiri

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •