Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing Hard Code Paths in the Data Caption Property
Message
 
À
27/09/1999 15:03:09
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00269341
Message ID:
00269558
Vues:
24
>Hi there!
>
>I want to use a variable (defined in main procedure) in the properties of an object.
>
>E.g.
>I have a dataset (object) in a Form.
>
>I want the properties of that object i.e
>
>DatabaseName to have as value a variable that has been defined in my main module.
>
>The variable drives a path name from an Ini file. So far it's Ok.
>
>But I'm not able to pass the value of this variable(which now contains the path) to the property DatabaseName.
>
>Is it possible to give as value a variable name in the DatabaseName property ?
>
>Or I'm compelled to give the path itself as value in the property ?
>
>Thx.
>Akshay

You have to do it the way I just wrote in my last message, ie:
data1.DatabaseName = YourVariable
data1.Refresh

You can't put your variable name in the properties of the object. The reason is that things that are in the properties are compiled and therefore need to be constant. If you variable (your case), you have to assigned it at design time just like the sample I give you.

Is it answering your question?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform