I'm trying to connect to Sybase ASE 15 using ADO.net in a Powershell script
At the beginning of the shell I got the load of the DLL :
Add-Type -AssemblyName "Sybase.AdoNet2.AseClient, Version=2.157.1330.0, Culture=neutral, PublicKeyToken=XXXXXX"
Since I have to loop over more than 15 servers each one running on a different port, I was quite satisfied of the option of specifying the DSURL option in the connection string :
$SybaseConn.ConnectionString = "DSURL='file://C:\sybase\ini\sql.ini?SQL_MIDOFF_OPC1';Data Source='TheServer';Database='master';UID='sa';PWD=’blablabla’;"
Unfortunately I'm getting the error : "Exception calling "Open" with "0" argument(s): "Cannot locate reference to the DB server specified in DSURL."
Has someone already used this option and give me a push to finish this ?
Thanks in advance !
Got it, I thought that the word "SQL_MIDOFF_OPC1" was part of the syntax, in fact, it was the server name, the syntax is
$SybaseConn.ConnectionString = "DSURL='file://s:\sybr\ini\sql.ini?MyServer;Database='master';User Id=sa;Password=XXXXX