Link to home
Start Free TrialLog in
Avatar of gopikrish
gopikrish

asked on

Problem in Set cn = New Connection

Sorry I am just a beginner to vb and I am using vb 6 Enterprise edition.
When I do,

 Public cn As Connection
 Private Sub cmdLogin_Click()
 Set cn = New Connection

 So as soon as I type the word "New" in the above statement a list is appearing having word "Collection" but its not  having "Connection". But iam having a project done by my friend and when I checked the same it showed "Connection" in that pop up list. So what is the problem? Thanks.
ASKER CERTIFIED SOLUTION
Avatar of ampapa
ampapa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pique_tech
pique_tech

In line with ampapa's suggestion above, I've found that code readability, especially 6 months after I last looked at it, is greatly improved by DIMming everything with the type library it comes from, i.e.,
Public cn As ADODB.Connection
...
Set cn = New ADODB.Connection

etc.

For what it's worth...
Avatar of gopikrish

ASKER

Wow thanks ampapa you are right :)
Glad I could help.