Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2006

Tip: Looking for answers? Try searching our database.

get query field properties in vba

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
YisMan - 26 May 2006 10:15 GMT
hi, everyone
id like to return the name and such of all fields in a query.
ive researched the adox.command properties and have not found any help
can anybody help me with this one?
Signature

Thankfully, YisMan

Ofer Cohen - 26 May 2006 13:16 GMT
Try this function, pass to it the name of the query

Function GetFieldName(QueryTableName As String)
 Dim R As DAO.Recordset
 Dim j As Long

 Set R = CurrentDb.OpenRecordset( _
   "SELECT * FROM " & QueryTableName & " WHERE FALSE", dbOpenSnapshot)
 For j = 0 To R.Fields.Count
   Debug.Print j, R.Fields(j).Name
 Next
 R.Close

End Function

Signature

Good Luck
BS"D

> hi, everyone
> id like to return the name and such of all fields in a query.
> ive researched the adox.command properties and have not found any help
> can anybody help me with this one?
YisMan - 27 May 2006 22:20 GMT
Todah
i was aware of the DAO option. I am looking if possible to do it with ADO/ADOX
probably with the ADOX.command property
please advise
Signature

Thankfully, YisMan

> Try this function, pass to it the name of the query
>
[quoted text clipped - 15 lines]
> > ive researched the adox.command properties and have not found any help
> > can anybody help me with this one?
Ofer Cohen - 29 May 2006 16:46 GMT
מצטער
Sorry it took me a while to answer, I don't have an answer for that, mybe
start a new thread, I'm sure you'll get an answer from somebody else.

Signature

Good Luck
BS"D

> Todah
> i was aware of the DAO option. I am looking if possible to do it with ADO/ADOX
[quoted text clipped - 20 lines]
> > > ive researched the adox.command properties and have not found any help
> > > can anybody help me with this one?
 
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



©2008 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.