Re: VB Connection to Informix Database
Posted in 1998
Topics: Connectivity: ODBC / JDBC / .NET
Paul Yurga wrote: > Is there a way to programatically connect to an Informix 7.x Database > through ODBC (Using InterSolv DataDirect Connect ODBC) in Visual Basic > 5.0 (sp3) without defining a DSN? I would like to shield the user from > the complexity of the ODBC Data Source Administrator if possible. > > Thanks, > Paul Yurga > Lucent Technologies Here is how to do it with RDO. Something along these lines should also work if you are using DAO. ----------------------------------------------------- Dim CN As New rdoConnection Function ifmx_connect(ByVal db As String, ByVal server As String, _ ByVal user As String, ByVal passwd As String) Dim s As String s = "DRIVER={INTERSOLV 3.01 32-BIT INFORMIX};" ' or use {Informix-CLI 2.5 (32 bit)} s = s & "UID=" & user & ";PWD=" & passwd & ";" s = s & "DB=" & db & ";SRVR=" & server & ";" CN.Connect = s CN.CursorDriver = rdUseNone ' or whatever you need. CN.EstablishConnection End Function ----------------------------------------------------- Hope this helps. Christoph Breitkopf Magrathea Informatik GmbH