Connecting to SAP DB using ODBC - odbc

I'd like to access a SAPDB database using ODBC so I've installed the latest ODBC driver from http://www.sapdb.org/
I'm trying to create a connection using the following connection string:
DRIVER={SAP DB (Unicode)};SERVER=192.168.12.11;DATABASE=ADQ;UID=ADQTEST;PASSWORD=TESTABC;
However I get the following error message:
[SAP AG][SQLOD32 DLL][SAP DB] Invalid authorization specification;-4008 POS(1) Unknown user name/password combination
I'm fairly certain that the username/password I'm using is correct (we've verified multiple times).
I also don't think it's a general network problem since if I give it a non-existing database it actually complains about the "database not running". Only with the correct database I get the invalid authorization error.
I'd very much appreciate any hints anyone might be able to give me.
Best regards,
Thomas

The ODBC attributes for user id and password are UID and PWD not UID and PASSWORD.

Related

MariaDB - Unable to login via user - error in password character encoding

I created a new user for the existing DB, however I am unable to login via the new user. I get the following error. I use DBeaver client. MariaDB runs as docker container.
Error:
Current charset is UTF-8. If password has been set using other charset, consider using option 'passwordCharacterEncoding'
I saw some solutions regarding this problem, however I want to know the reason this happens and better solution other than uninstalling DB etc.

SQL Server 2017 ODBC via Rstudio or R on SSMS gets connected only to master database

I have been working on SQL Server 2017 via R (on Rstudio as well as R on SSMS) and i am unable to connect to a specific database. I mention the database name in the connection prompt but, it gets connected only to the master database. Is there something that I am missing while connecting?
The syntax I use for connection is:
conn = "Driver={ODBC Driver 13 for SQL Server};server=;Uid=uid; pwd=pwd;Database = mydb"
I am trying to use both RevoscaleR as well as ODBC() package in Rstudio to connect to a specific database but, it still gets connected to master database. Using RStudio connections pane, if i try to explore the other databases, it shows only dbo schemas and no other schemas even if they exist. Can someone help me in figuring out what might have gone wrong?
Most likely the login you use (the uid) is not authorized for that particular database (it is not created as a user in that database).
Some example code you can run in SSMS as - for example - sa:
--switch over to the database in question
USE mydb
GO
CREATE USER uid FOR LOGIN uid;
The above code creates a user in the database in question with the same name as the login.
Hope this helps!

odbcDriverConnect issue trying to connect to an Access Database in R

I am using R 32 bit and am having an issue trying to get the odbcDriverConnect function to work when trying to connect to an Access database. I have successfully connect to the database using odbcConnect, but am also trying to learn how to use the odbcDriverConnect function.
My code is
scallopdata<-odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=S://adv/Scallop Central/2014 RSARR/2014 RSA Database_9_3_2014.mdb;
Uid=admin;Pwd=")
When I run the code, I get an error message of
ODBC Microsoft Access Driver Login Failed. Could not find file S://adv/Scallop Central/2014 RSARR/2014 RSA Database_9_3_2014.mdb.
I click the OK button which takes me to a Login box. I select the Database... button. This brings me to a Select Database box where I can select the same database that is specified in the Dbq section of code. Once I select the correct database and click OK I am connected to the database.
I am hoping to use the odbcDriverConnect function so that I do not have to set up a new odbc DSN for each database I would like to access. This may just be me not fully understanding the function.
If any one can provide so insight, it would be very helpful.

How to avoid storing userid/password in the .odbc.ini file on Linux?

I am connecting to a Teradata database through ODBC with Stata on an Ubuntu server (12.04 LTS). Everything works fine, except that I have my TD userid and password stored in the .odbc.ini file, which seems like a terrible idea. The alternative is to enter them in Stata, which seems even worse and is awkward. Is there a way to do this more securely? The login info that I use to ssh into the server is synced with the TD database. It seems that it should be possible to pass that information along.
In ODBC terms you do not need to store usernames / passwords in any of your ODBC ini files. Both the ODBC SQLConnect and SQLDriverConnect support the passing in of username / password at the time they are called.
SQLDriverConnect would need something in your InConnectionString like "DSN=YourDataSourceName;UID=username;PWD=password".
You could go one step further and pass in the whole DSN as a command line argument thus meaning that you would not need an ODBC data source in an ini file. I'm sure one of the forum readers can post a sample for you from Teradata.
As for passing in the user name and password from your SSH loging. Your application would need to capture that and pass it to ODBC.
If you want to establish a finer grain of security around your odbc.ini file or other files on your Ubuntu server that may contain user credentials I would strongly suggest the use of Access Control Lists (ACLs). Beyond the typical Owner::Group::World permissions you can specify permissions down to the specific user on whether they are allowed or denied an explicit permission for a given file.
Other options regarding security on Teradata include the use of LDAP authentication if your environment supports it. Configuring LDAP on Teradata is beyond the scope of SO and in many cases a billable, professional services engagement with Teradata's Information Security CoE.

Error while running ASP site

I have set Data Source(ODBC) for running ASP Site in my local Computer selected Microsoft Access Driver.
Now I can run the whole site with out error.But If i apply leave then it will show an error.
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an
updateable query. /eleave/leaveApplicationOut.asp, line 39
Updation
After giving the Write permission following error is showing
Error Type:
jmail.Message (0x8000FFFF) The message was undeliverable. All servers
failed to receive the message /eleave/leaveApplicationOut.asp, line 80
Thank you very much for your support.
It is solved..
4 possible causes are highlighted here: http://support.microsoft.com/kb/175168
I am guessing it's #1:
The most common reason is that the Internet Guest account (IUSR_MACHINE), which is by default part of the "Everyone" group, does not have Write permissions on the database file (.mdb). To fix this problem, use the Security tab in Explorer to adjust the properties for this file so that the Internet Guest account has the correct permissions.
First error (which seems like you solved) has to do with write permissions on the database..
The updated question ,though, seem to be completely unrelated..
You seem to be trying to send an email, right ? and it says it failed..
Perhaps the SMTP service is not running and so it cannot send the email ? could it be a wrong IP address defined somewhere ? wrong credentials for the email accounts ? (read http://host.cdesystems.com/faq/jmail_faq.asp for possible problem)
give some code about the configuration you do to the jmail ..

Resources