db connection string to informix

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
jramon.r@tv3.cat
Posts: 21
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Mon Jan 19, 2015 2:32 am

db connection string to informix

Post by jramon.r@tv3.cat »

I'm trying to connect to an informix db.

This is the script

$sqlText='SELECT * FROM dtvc_volum'

$ConnectString="Provider=IFXOLEDBC.2;Password=xxxxx;User ID=xxxxx;Data Source=digition@ol_montsia; Persist Security Info=true"

$da=New-Object System.Data.OleDb.OleDbConnection
$ds=New-Object System.Data.DataSet
$conn=New-Object System.Data.OleDb.OleDbConnection($connectString)
$conn.Open()
$cmd=New-Object System.Data.OleDb.OleDbCommand($sqlText,$conn)
$cmd.CommandType='Text'
$da.selectCommand=$cmd
$ret=$da.fill($ds)
$ds.Tables[0]
$conn.close()

but it shows me this error "the ifxoledbc.2 provider is not registered on the local machine"

With vbscipt i can connect to informix with no problem in the 

Can you help me?

Thank you

jvierra
Posts: 14231
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: db connection string to informix

Post by jvierra »

Install the Informix client software and the OLEDB drivers for Informix.

In VBScript you may be using the ODBC drivers or a native connection. Without an example we cannot really tell.

Another classic issue is running 64 bit PowerShell or Net Applications and only having the 32 bit drivers installed. Be sure you are running in the correct context for your drivers.

To browse the drivers use the following method:
1 create a file named test.udl on the desktop by creating a new text file and renaming it.
2 Double-click file to open. If all ADO components are installed correctly the connection wizard will open. Look at the provider list. Do you see Informix listed.

User avatar
jramon.r@tv3.cat
Posts: 21
Joined: Mon Jan 19, 2015 2:32 am

Re: db connection string to informix

Post by jramon.r@tv3.cat »

Thanks,

Now it's ok. The problem was the 32 bits driver installed

Locked