>Hi there folks, I just wanted to share this tip with you all. Hope you might find this useful. Regards
>
>Let's say we wanna create an oledb (ADO) connection by invoking the connection property dialog. Here's the code to do that.
>
>public oConn as adodb.connection
>local oData as object
>
>odata=createobject("datalinks")
>oConn=oData.PromptNew() && We select our data source here
>=oConn.Open()
>
>There it is a valid ado connection without recalling any specific connection string.Angel:
It is a nice tip, but not new information as Sergey mentioned.
One point that bugs me in your example is the use of a Public variable. Any good reason why?
IMO there is no good reason in this example (or in almost anything done in OOP) for a Public declaration. Try to avoid them as they can create difficult to track bugs.
In this case, if you want to maintain the oConn object in scope you could define it as a property of some object (i.e. a form or an application object).
HTH