I have installed an oracle 12 Client on a windows 8 computer and on a windows 7 computer.
Using sqlplus I can connect to my database. Also the tnsping shows the right tns.
But when I try to set an odbc connection the TNS list is empty.
If I try to type the tns connection the test works, but when I try to launch my program from visual studio 2013 I get a general connection error.
I've already tried the fixes I could find on the internet (like checking that I have the 64 bit client and the 64 bit app, making a TNS_ADMIN environment variable set).
Mostly I'm wondering about the odbc problem.(this app is not using this type of connection, but I'm considering it - if I can be sure there are no problems).
Related
I recently upgraded from Windows 7 to Windows 10 and had to reset some remote database connections. I had previously been connecting quite successfully to an Oracle database using the Oracle 11g client and RODBC.
library(RODBC)
channel<-
odbcConnect(dsn="myoracleDB",
uid='myusername',
pw='mypassword',
believeNRows=FALSE)
result<- sqlQuery(channel,"select * from schema_name.table_name")
close(channel)
Since the Windows 10 upgrade, the above connection protocol no longer works. Specifically, I get the following error:
channel<-
odbcConnect(dsn="myoracleDB",
uid='myusername',
pw='mypassword',
believeNRows=FALSE)
Warning messages:
1: In RODBC::odbcDriverConnect("DSN=myoracleDB;UID=myusername;
PWD=mypassword",:
[RODBC] ERROR: state HY000, code 12170, message [Oracle][ODBC]
[Ora]ORA-12170: TNS:Connect timeout occurred
2: In RODBC::odbcDriverConnect("DSN=myoracleDB;UID=myusername;
PWD=mypassword",:ODBC connection failed
Two additional observations are relevant here:
I use the Windows command line to execute tnsping myoracleDB which returns a successful connection to the database
I can also use Oracle's SQL Developer Application to successfully connect to and query from the database.
So I feel confident that the Oracle Client and the ODBC Data Sources are set up correctly.
Interestingly, I AM able to connect to my database using the RODBC library if I use the following code:
mycon = odbcDriverConnect("Driver={Oracle in OraClient11g_home1};
Dbq=myoracleDB; Uid=myusername; Pwd=mypassword;",
believeNRows=FALSE)
My question for the community is:
This new connection protocol works (which I'm happy about). However, since I don't really understand why it works when the approach that worked before no longer works, I fear I may be ignoring some underlying problem that could really hurt me down the road.
I have found the following SO threads to be helpful, though neither really addresses my issue exactly:
Failure to connect to odbc database in R
Connect to ORACLE via R, using the info in sql developer
UPDATE:
I have accessed the Windows ODBC 64 bit menu and verified that I do have a DSN called "myoracleDB" which is assigned to the "Oracle in OraClient11g_home1" driver. I have tested this connection and find that it works fine. I have also used the RODBC line:
odbcDataSources()
in RStudio and found that the data source "myoracleDB" is recognized. However, when I try to execute:
channel<-
odbcConnect(dsn="myoracleDB",
uid='myusername',
pw='mypassword',
believeNRows=FALSE)
I still get the error:
"TNS: Connect timeout occurred ODBC connection failed"
If you check out the docs, DSN=myoracleDB tells RODBC to connect to the Windows DSN "myoracleDB", while Dbq=myoracleDB tells RODBC to connect to the TNSNAMES entry "myoracleDB". They're two different ways of resolving database names. tnsping and SQL Developer also both use TNSNAMES to resolve databases.
So I think your DSN probably got deleted when you reset things. You can test it by going to Control Panel > Administrative Tools > Data Sources (ODBC). If your database is there, you should be able to Configure it and click Test Connection to make sure it's working. Otherwise you can add it there, and your original configuration should work again.
I am trying to set up an .accdb as a datasource on the reporting server. The database is local on the server and I have followed all the instructions to create a 32 bit and a 64 bit ODBC connection for .mdb and .accdb. I set up the data source on the Report Manager site as ODBC with dsn=dbname and test the connection and it is successful.
From the Report Manager site, I open a report in Report Builder. I add a dataset and point to the shared connection. Test connection is successful.
I create a new data set based on this data source and click Query Designer and get this error: Unable to Connect to Datasource dbname. ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application.
Then I prompted for credentials. Of course nothing works there. And this particular .accdb has only Admin with no password anyway. All users can access it.
The error makes me think there's a 32 bit vs 64 bit conflict. The .accdb is 32 bit, but Report Manager only sees it with the 64 bit connection, then tanks when I try to create the data set.
I've set the same odbc connections up on my local machine and on the server. Still no dice. Any and all help would be appreciated.
I kept working on this and was able to create a data source with the following connection string:
Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=\server\path\database.accdb;Uid=Admin;Pwd=;
I edited the report and used query builder to test the query and results. Query builder allows me to see results. Yay! Progress!
But now when I preview/run the report I get the following:
An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'dataset1'. (rsErrorExecutingCommand)
For more information about this error navigate to the report server on the local server machine, or enable remote errors.
Any ideas?
I was able to make this work. I had to install the 32 and 64 bit drivers on both the reporting server and the local (editing) machine. I created identical DSNs (32 bit and 64 bit) on each machine. Then set up the datasource with an OLE DB connection string.
Once complete, I was able to write reports against the database (but not browse tables). Other users could access the report from their own machines without the ODBC connections or drivers installed.
We'll call this a win. On to the next problem.
I have an asp page which brings data from DB through ODBC connection, but it's failing. The stored proc is defined in the asp page which brings the data, SP seems to be fine but data is not coming.
Post the error, blur your passwords (hope that box isn't exposed.)
Your error is likely a missing ODBC driver. Check whether your sites AppPool is running 32 bit or 64 bit, then check the respective ODBC Manager to see if the driver you are using exists on the machine. If not go download one for whatever database server you are using and install it.
If you have windows 8+ or 2012 Server + on the server, just use the start screen search to find the ODBC managers, can't remember their run commands, and their difficult to find in the UI, I don't even remember where they are.
This commonly happens when people switch their app pool from 32 bit to 64 bit in a server upgrade, or just to run 64 bit. There are two versions of ODBC drivers, one 32 and one 64 bit. If you don't have the 64 bit ODBC driver and switch the app pool to 64 bit, your DB access will time out or fail. ASP commonly has "On Error Resume Next" all over the place, so might be eating the error and showing something generic instead.
I have sorted out this issue.Commented out the ODBC section and created a new SQL connection string directly in the asp page-
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConn
"Provider=SQLOLEDB;Server=SERVER\INSTANCE;Database=DBName;UID=*;PWD="
I need to reduce the time to get an error when connecting to an unavailable instance.
The problem is that I can't modify the machine configuration. And currently I'm using the ODBC drivers.
The Informix client-sdk can be from 3.50 to 3.70tc3
the instance version is probably 10.x
and the clients run from windows XP thru Windows 7
Set the environment variable INFORMIXCONTIME to any value in seconds that fits your application
I am having a problem with an a lotus 8 agent running on a server.The agent tries to fetch data form a sybase database (using Sybase 11 ODBC driver).I can run the same agent from a cleint machine with no error, but when the agent runs on the server it ends with the following error. -> LS:DO- ODBC could not complete the requested operation.
If you have any ideas please forward it.
Thanks
Check that the odbc connection is setup properly on the server.
According to this post This might be related to a Bug. But in your case I'm pretty sure it's got something to deal with DSN (TCP/IP shared memory) misconfiguration.