I have a requirement to use special characters in an Informix ODBC connection string from within a Powershell script. The password should match the users Windows password. Several ODBC related posts suggest using braces {...} to protect the password, but this does not work.
I'm using Informix ODBC driver 3.34 32BIT
The following connection string with a simple password works:
$conn.connectionstring = "DSN=PD7333;Uid=generic;Pwd=readonly;"
This does not work.
"DSN=PD7333;Uid=generic;Pwd={readonly};"
Any suggestions to protect special characters in an Informix ODBC connection string?
Related
I need to connect my Microsoft Report Builder to Oracle DB but I could not seem to find the correct connection string for Oracle.
I tried:
Specifying username and password
Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;Integrated Security=no;
but it returned:
Is it saying that I need to download the Oracle driver? Or should I get the connection string for Oracle DB?
If you don't already have it, you will need the Oracle Client installed. It will include an ODBC driver. ODBC is a wrapper for the Oracle Client, not a replacement. When setting up your connection you will also need to get the connection properties from the DBA (e.g. hostname/ip address, port, service name, username and password).
See documentation here:
https://docs.oracle.com/en/database/oracle/oracle-database/19/adfns/odbc-driver.html
https://www.oracle.com/database/technologies/releasenote-odbc-ic.html
I was able to get connected to Oracle using the ManagedDataAccess (.net) connection for Oracle, but is there a way to use OracleCredential instead of the string password in the connection string?
I have an Oracle database installed on my computer, and I can connect to it with both Oracle Developer and SQL*Plus. Using either of these tools, is there any way to determine the connection string used for the existing connection?
In sql*plus, it stores the safe things (not the password) in _USER, _CONNECT_IDENTIFIER and _PRIVILEGE defined variables. By default, you can access them like:
prompt &_USER.#&_CONNECT_IDENTIFIER &_PRIVILEGE
I am using Python3.6 and pyodbc to try and connect to Teradata. I need this for a script I want to hand off to an end user to update from data. I would prefer that each user not have to be instructed to setup their own DSN connection with a specific name I hard encode into the script.
I think I have the driver correct now as well as the server and DB name. What I can't figure out is how to get the connection string to not require a username and password.
Helpful info:
This is for windows OS. When I go to ODBC connections in windows, connection mechanism is listed as LDAP and i can connect through the Teradata program as well.
What does work:
Connection directly through the Teradata program (showing Teradata itself knows who I am)
Using DSN="DSN_name" where DSN_Name is the name under ODBC connections found in windows. Showing I can connect via DSN.
-Looking at ODBC Data Source Admin shows Driver matches what I have. "Server Name or ID" matches "servername" below.
Tried:
connect_string = 'Driver={Teradata Database ODBC Driver
16.20};DBCName=servername;Database=db_name;MechanismName=LDAP;UseIntegratedSecurity=1;'
con = pyodbc.connect(connect_string)
which gives:
pyodbc.Error: ('HY000', '[HY000] [Teradata][ODBC] (11210) Operation not allowed during the transaction state. (11210) (SQLExecDirectW)')
connect_string = 'Driver={Teradata Database ODBC Driver
16.20};DBCName=servername;Database=db_name;MechanismName=LDAP;'
con = pyodbc.connect(connect_string)
or
connect_string = 'Driver={Teradata Database ODBC Driver
16.20};DBCName=servername;Database=db_name;Authentication=LDAP;'
con = pyodbc.connect(connect_string)
which gives:
pyodbc.InterfaceError: ('28000', '[28000] [Teradata][ODBC Teradata Driver] (2) Unable to logon with Authentication Mechanism selected. (2) (SQLDriverConnect)')
I have also tried a few other suggested authentication mechanisms in addition to LDAP, but this is the one listed in Teradata and ODBC connections.
In SQL_Server I use something like trusted_connection=yes to achieve the same effect I desire which doesn't seem to work in the above examples.
error:
pyodbc.OperationalError: ('08001', '[08001] [Teradata][ODBC] (10380) Unable to establish connection
with data source. Missing settings: {[Password] [Username]} (10380) (SQLDriverConnect)')
I'm trying to connect to an Oracle Server using ADO and Oracle Wallet,
First of all, my wallet IS working. I have tested it using
SQLPLUS /#DDKTEST
If I provide username and password in my connection string it works fine:
Provider=MSDAORA;Password=<my password>;User ID=<My user ID>;Data Source=DDKTEST;Persist Security Info=True
But I'm stoked when I need to make a Connection String for Oracle Waller
I've tried the following:
Provider=MSDAORA;Data Source=DDKTEST;Persist Security Info=True
But it doesn't work.
So in short: I need a connection string for ADO, in order for connection to Oracle using my Wallet.
The connection string that we are using with wallets is:
Provider=OraOLEDB.Oracle;Data Source=TNSName;OSAuthent=1;
We use this successfully with TADOConnection in Delphi (first XE5, now 10).
Where TNSName is an alias as defined in TNSNames.ora. I must note that we use a different provider (reflected in the provider name, OraOLEDB.Oracle), and I don't know if this will also work with the outdated and deprecated MSDAORA.
We did use MSDAORA before, but switched to OraOLEDB before we started using the wallets. I do remember that it was quite primitive and didn't even support BLOBs, so I'm not very confident it will support wallets at all.