Jump to content
Sign in to follow this  
rippa

informix connection

Recommended Posts

rippa

Hi everybody,

I would like to connect to an informix db. I've installed an informix odbc connect driver and configured a dsn entry, but I don't know how to connect to this db. I've read that this is possible with connection strings, but is there not an easier way using the dsn entry ?

Thanks !

Share this post


Link to post
Share on other sites
ptrex

@rippa

Something like this :

; Informix

$objConn = ObjCreate("ADODB.Connection")

$objConn.Open ("Dsn=myDsn;" & _
           "Host=myHostname;" & _
           "Server=myServerName;" & _
           "Service=myServiceName;" & _
           "Protocol=onsoctcp;" & _
           "Database=myDbName;" & _
           "Uid=myUsername;" & _
           "Pwd=myPassword")

$rsCustomers = $objConn.Execute("SELECT * FROM Customers")
With $rsCustomers
    While Not .EOF
        ConsoleWrite(.Fields("CustomerID").Value & " - " & .Fields("CompanyName").Value & @LF)
        .MoveNext
    WEnd
    .Close
EndWith

$objConn.Close

regards

ptrex

Edited by ptrex

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.