Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
How do I get the column (field) names of a table using VB? |
Author |
Message |
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-03-30 08:36:17 |
I need to build in VB a disconnected recordset that lists all of the fields for a given table, somewhat similar to what the VB demo program shows when you run 'sp_columns tablename', though I only need the field names and description, if it is available. Can you give me some direction? |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-03-30 08:41:00 |
Just do:
Const adUseClient = 3 rs.CursorLocation = adUseClient
strSQL = "sp_tables" 'Open rs rs.Open strSQL, cnConnection, adOpenStatic, adLockReadOnly
And loop through the recordset for each table:
then:
strSQL = "sp_Columns """ & sTableName & """" 'Open rs rs.Open strSQL, cnConnection, adOpenStatic, adLockReadOnly
And spin through the columns for that table.
|
|
|
|
|