If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > MS Example Programatically Creating Schema.ini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-03-03, 21:30
Brad_B Brad_B is offline
Registered User
 
Join Date: Feb 2003
Posts: 5
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
Reply With Quote
  #2 (permalink)  
Old 02-04-03, 00:53
playernovis playernovis is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 02-04-03, 02:28
Brad_B Brad_B is offline
Registered User
 
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).
Reply With Quote
  #4 (permalink)  
Old 02-04-03, 23:25
playernovis playernovis is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On