Tengo la siguiente Clase:[color=#0000ff size=2]


Imports[/color] Microsoft.VisualBasic
[color=#0000ff size=2]Imports[/color] System.Data[color=#0000ff size=2]


Public[/color] [color=#0000ff size=2]Class[/color] conectarissste


[color=#0000ff size=2]Public[/color] conn [color=#0000ff size=2]As[/color] [color=#0000ff size=2]New[/color] IfxConnection


[color=#0000ff size=2]Public[/color] [color=#0000ff size=2]Function[/color] MakeConnection([color=#0000ff size=2]ByVal[/color] Host [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color], [color=#0000ff size=2]ByVal[/color] ServiceNum [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color] _


, [color=#0000ff size=2]ByVal[/color] Server [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color], [color=#0000ff size=2]ByVal[/color] Database [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color], [color=#0000ff size=2]ByVal[/color] User [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color], _


[color=#0000ff size=2]ByVal[/color] Password [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color]) [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color]


[color=#0000ff size=2]Dim[/color] ConnectionString [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color]


ConnectionString = [color=#800000 size=2]"Host="[/color] + Host + [color=#800000 size=2]"; "[/color] + _


[color=#800000 size=2]"Service="[/color] + ServiceNum + [color=#800000 size=2]"; "[/color] + _


[color=#800000 size=2]"Server="[/color] + Server + [color=#800000 size=2]"; "[/color] + _


[color=#800000 size=2]"Database="[/color] + Database + [color=#800000 size=2]"; "[/color] + _


[color=#800000 size=2]"User Id="[/color] + User + [color=#800000 size=2]"; "[/color] + _


[color=#800000 size=2]"Password="[/color] + Password + [color=#800000 size=2]"; "[/color]


conn.ConnectionString = ConnectionString


[color=#0000ff size=2]Try[/color]


conn.Open()


[color=#0000ff size=2]Return[/color] [color=#800000 size=2]"Conexion Realizada!"[/color]


[color=#0000ff size=2]Catch[/color] ex [color=#0000ff size=2]As[/color] IfxException


[color=#0000ff size=2]Return[/color] [color=#800000 size=2]"Problema con la conexion: "[/color] & ex.Message


[color=#0000ff size=2]End[/color] [color=#0000ff size=2]Try[/color]


[color=#0000ff size=2]End[/color] [color=#0000ff size=2]Function

End Class



[/color][color=#0000ff size=2]Public[/color] [color=#0000ff size=2]Function[/color] DameClaves() [color=#0000ff size=2]As[/color] DataTable


[color=#0000ff size=2]Dim[/color] cmd [color=#0000ff size=2]As[/color] [color=#0000ff size=2]New[/color] IfxCommand


[color=#0000ff size=2]Dim[/color] mensaje [color=#0000ff size=2]As[/color] [color=#0000ff size=2]String[/color]


cmd.CommandText = [color=#800000 size=2]"Select articulo_cata,desc_cata from catalogo"[/color]


cmd.Connection = conn


[color=#0000ff size=2]Dim[/color] da [color=#0000ff size=2]As[/color] [color=#0000ff size=2]New[/color] IfxDataAdapter


da.SelectCommand = cmd


[color=#0000ff size=2]Dim[/color] ds [color=#0000ff size=2]As[/color] [color=#0000ff size=2]New[/color] DataSet


da.Fill(ds)


[color=#0000ff size=2]Dim[/color] dt [color=#0000ff size=2]As[/color] [color=#0000ff size=2]New[/color] DataTable


dt = ds.Tables(0)


[color=#0000ff size=2]Return[/color] dt


[color=#0000ff size=2]End[/color] [color=#0000ff size=2]Function[/color]

2-Cuando mando llamar a la funcion DAmeClaves me marca el error:
no se ha inicializado ConnectionString, entonces lo que hice fue mandar llamar la funcion makeconnection desde la funcion(DameClaves) para que funcione y me devuelva los datos, sin embargo lo que deseo es utilizar esta conexion en todo el proyecto, he probado ejecutarla desde el _Load del proyecto y si se realiza la conexion, sin embargo no la puedo utilizar en otras funciones para conectarme. ¿Que me falta modificar para hacer que esto me funcione?
Gracias...