db connection string to informix

Ask your 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.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jramon.r@tv3.cat
Posts: 25
Last visit: Tue Jan 11, 2022 4:23 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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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: 25
Last visit: Tue Jan 11, 2022 4:23 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
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked