Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / November 2007



Tip: Looking for answers? Try searching our database.

OpenSchema order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geoff - 04 Nov 2007 13:55 GMT
I am a bit new to this, I hope for some help
I am trying to load info of the columns from various database tables.

Set objRS = objConn.OpenSchema(adSchemaColumns,
Array(Empty,Empty,strTableName,Empty))

Now this works fine except the problem I have is that it loads the recordset
with info of the columns in alphabetic order.
Is it possible to load the info in the order the tables are created
Thanks Geoff
Bob Barrows [MVP] - 04 Nov 2007 14:20 GMT
> I am a bit new to this, I hope for some help
> I am trying to load info of the columns from various database tables.
[quoted text clipped - 6 lines]
> Is it possible to load the info in the order the tables are created
> Thanks Geoff

I see no way for this to be done with OpenSchema.
Neither do I see a way for it to be accomplished with ADOX.
Depending on what database you are using, this information may be available
in a system table.
Opening a recordset using "select * from tablename where 1-2" MIGHT give you
a set of fields in the order you desire, but there is not guarantee that
this will work in all cases. You're pretty much at the mercy of whatever
data provider you are using.
Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Geoff - 04 Nov 2007 23:51 GMT
> I see no way for this to be done with OpenSchema.
> Neither do I see a way for it to be accomplished with ADOX.
[quoted text clipped - 4 lines]
> this will work in all cases. You're pretty much at the mercy of whatever
> data provider you are using.

I am using Access+Jet
Thanks, I have managed to fix it by loading first  the schema column items
data into a objCopyColumnDict
and then loading a recordset as you suggested  ("Select * From " &
strTableName)
The recordset is in the order I want, so I can get column info items swapped
from objCopyColumnDict
in the order I want.

For Each objField in objRS.Fields
   objColumnDict.Add (objField.Name,
objCopyColumnDict.Item(objField.Name) )
next
objCopyColumnDict. = nothing
objColumnDict. alls well

Thanks for your help Bob
Regards Geoff
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.