Avoid using code like this
Code:
Dim db_name, db_server, db_port, db_user, db_pass, constr As String
In VB6, each variable MUST be explicity declared or it will be created as a Variant. In the above, only constr is actually a string. To be accurate, the line would have to be
Code:
Dim db_name As String, db_server As String, db_port As String, db_user As String, db_pass As String, constr As String