Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Bound Grid Control index
Message
From
22/11/1997 19:28:36
Nicolas Bastien
Point Exe Informatique Inc.
Montréal, Quebec, Canada
 
 
To
18/11/1997 11:42:13
General information
Forum:
Visual Basic
Category:
ActiveX controls
Miscellaneous
Thread ID:
00060939
Message ID:
00061778
Views:
39
>How can I create index using the Data Bound Grid Control in a Visual Basic form?
>
>In the form Init(), I would like to define several index and be able to switch index at run time.

I'm not shure of wath you want but,

If you tried to create new index on a table that is currenty bind on a grid.

Your grid is link to a Data control with have a record set :

1 - You need to know with Table is currently on your Data Control.
If your RecordSource is a SQL Statement, you will have to search it aferter the Keyword "For" of your SQL statement
If it's a table name you gat it direcly.

2- Your have to defind a TableDef object
Dim TB as TableDef

3- From your database object you link on the structure of your Table by the collection of tables of your database:
Set Tb = DB.TableDefs("TableName")

4- Inside your TableDef object, you have a collection of index name : Indexes (I'm not comple sure of the name).
From that collection you could add a new index that you juste create
Dim MyIndex as new index

...... ' Create the index
5- Inside your index you have a collection of fields
Dim MyField as new Fields

MyField.name = "MyNameField"
' other porperty

' Add it to your Index
MyIndex.Fields.Add MyField

' Ad it to your collection
TB.Indexes.Add MyIndex
Nicolas Bastien
President de Point EXE informatique inc.
President du Groupe Visual Basic Montreal
Email : pointexe@ergonet.com
Info : (514) 522-3255
Previous
Reply
Map
View

Click here to load this message in the networking platform