ORA-01019 connecting to Oracle from Excel - oracle

I have installed Oracle 10g Express Edition. When try to test the connection I am getting the error "Error while trying to retrieve text for error ORA-01019".
Below is my code.
strConnection = "Driver={Microsoft ODBC for
Oracle};Server=Servername;Uid=username;Pwd=password;"
Set conn = CreateObject("ADODB.Connection")
conn.Open strConnection
conn.Close
Set conn = Nothing
Thanks in advance

I had the following error occur recently.
System.Runtime.InteropServices.COMException (0x80004005): ORA-01019: unable to allocate memory in the user side
at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options)
I managed to resolve the problem by simply modifying my connection string.
from:
"Provider=MSDAORA.1;Data Source=tprss;Persist Security Info=True;User ID=myUser;Password=myPassword"
To:
"Provider=MSDASQL;Data Source=tprss;Persist Security Info=True;User ID=myUser;Password=myPassword"
someone modified/updated the components on the box.

"ORA-01019 unable to allocate memory in the user side
Cause: The user side memory allocator returned an error.
Action: Increase the size of the process heap or switch to the old set of calls."
Followup from the comments:
Could you try this code?
Dim Cn As ADODB.Connection
Dim CP As ADODB.Command
Dim Rs As ADODB.Recordset
Dim Conn As String
Dim QSQL As String
'Connect to Oracele server begin
Conn = "DRIVER={ORACLE ODBC DRIVER};SERVER=Service name;UID=username;PWD=password;DBQ=Service name;DBA=W;APA=T;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;FRL=F;MTS=F;CSR=F;PFC=10;TLO=O;"
Set Cn = New ADODB.Connection
With Cn
.ConnectionString = Conn
.CursorLocation = adUseClient
.Open
End With
If Cn.State = adStateOpen Then
MsgBox "Connection successful."
End If
'Connect to Oracle server end
'close connection begin
Cn.Close
Set Cn = Nothing
Set CP = Nothing
'close connection end

(This didnt fit in a Comment box)
You need at least one driver. The oracle driver is best but Microsoft Driver will work too.
Lets first try to make a connection string. Right click on your desktop and the create a new .txt file.
Now rename your textfile to something.udl
Double click on the udl file. Go to "Provider" and select Microsoft OLEDB Provider for Oracle. Then click on next. In the server name field you fill in your TNS name. Then username and password and put a V inside "Allow saving password" (we will need this) And click on test connection. Make sure this works.
If it works then click on OK. Now open the UDL file with a text editor. You will see something similar to:
[oledb]
; Everything after this line is an OLE DB initstring
Provider=MSDAORA.1;Password=yourpw;User ID=youruser;Data Source=yourTNS;Persist Security Info=True
Copy this part into your connection string:
Provider=MSDAORA.1;Password=yourpw;User ID=youruser;Data Source=yourTNS
Now your connection string should look like:
Conn = "Provider=MSDAORA.1;Password=yourpw;User ID=youruser;Data Source=yourTNS"
I hope this works.

We had the same problem, specifically on Windows 7 when using the Microsoft OleDb driver from VB6.
Following the instructions in this post fixed out problem:
http://prasanth4microsoft.blogspot.com/2010/11/windows7-excel-vba-ora-01019-unable-to.html

I had this problem also but it is on win10.. After I have tried a lots of different solution from web .. Finally.. it worked to change connection string to fix this problem.. But I changed "Provider=MSDAORA.1" to "Provider=OraOLEDB.Oracle"

Related

How to connect to Database app path - vb6

Im trying to connect my databases(not binded/flexible) and it will run when the form activated. But in my code it kept error and didn't connected to the database. This is my last code:
Private Sub LoginForm_Activate()
Aadodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Database\Login.mdb;Persist Security Info=False"
Aadodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Database\login.mdb;Persist Security Info=False"
End Sub
I have ever connected it through the adodc property. But after i run it it broke if i move the folder to another folder so i tried to connect it using a flexible connectionstring.
I have found it out, the adodc should be refreshed Aadodc1.Refresh and the record source Aadodc1.RecordSource = "Select * from [table name]" must be defined. That's all :)

Connecting VBA with oracle 11g enterprise edition

I am trying to connect VBA to Oracle 11 g- I was checking whether the connection string was fine.
While trying below code I am getting error while opening the connection.
Runtime error-3706 Application defined or object -defined error.
Can anyone help?
Code:
Sub getdatafromOracle()
Dim connectdb As ADODB.Connection
connectdb.ConnectionString = "PROVIDER= OraOLEDB.Oracle;DATA SOURCE=DBname;USER ID=uname;PASSWORD=Pword"
connectdb.Open
connectdb.Close
End Sub
You habe to initialize the Connection object before you can use it.
set connectdb = New ADODB.Connection
Maybe you have to use this syntax (I am not sure):
connectdb.Open("PROVIDER=OraOLEDB.Oracle;DATA SOURCE=DBname", "uname", "Pword")

Sql developer custom connection string

How to use custom connection string in Oracle sql developer to connect?
jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=147.22.109.218)(port=1521))(ADDRESS=(PROTOCOL=TCP)
(HOST=147.22.109.219)(port=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=147.22.109.220)(port=1521)))
(FAILOVER=on)(LOAD_BALANCE=on)
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=cmphpd)))
Please help. Thanks
To us a TNS connection string, in the New / Select Database Connection window where you configure the connection:
Set Connection Type to TNS
Under the Details tab select Connect Identifier
Put the connection string into the text box next to Connect Identifier
Click Test if you'd like, to make sure it works
Click Save
Similarly, under Connection Type there also seems to be an option for a custom JDBC URL if that's what you prefer.
(Instructions and screenshot from version 19.4, in case it makes a difference)
Try this:
jdbc:oracle:thin:#147.22.109.220:1521/cmphpd
These are the best and complete instructions I've found.
https://blogs.oracle.com/dev2dev/ssl-connection-to-oracle-db-using-jdbc,-tlsv12,-jks-or-oracle-wallets
Below are the steps which I took to fix this issue:
Install JCE (following the instructions in Readme) - JCE
Add below lines in build.gradle
System.setProperty('oracle.net.ssl_version', '1.2')
System.setProperty('oracle.net.ssl_cipher_suites', '(TLS_RSA_WITH_AES_256_CBC_SHA256)')
System.setProperty('oracle.net.tns_admin', './lib')
System.setProperty('oracle.net.ssl_server_dn_match', 'true')
Setup db connection like
String connString = "jdbc:oracle:thin:#(description=(address_list=
(address=(protocol=tcp)(port=1521)(host=prodHost)))
(connect_data=(INSTANCE_NAME=ORCL)))";
OracleDataSource ods = new OracleDataSource();
ods.setURL(connString);
ods.setUser("scott");
ods.setPassword("tiger");
Connection conn = ods.getConnection();

Sage Line 50 ADODB connection with Classic ASP on IIS6 - Authentication Failed

We have a classic asp page running on IIS6, which connects to our Sage Line 50 (v17) with the following code:
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
Err.Clear
On Error Resume Next
adoCon.ConnectionTimeout = 0
ConStr="dsn=SageLine50v17;UID=uid;Password=pwd;"
adoCon.Open ConStr
If Err.Number <> 0 Then
Response.Write (Err.Description& "<br><br>")
Response.Write (Err.Number)
Response.End
End If
This works perfectly most of the time. However, occasionally, it throws the following error:
Authentication failed
-2147217843
My question is, what is causing the error? I'm thinking it is Sage throwing it back, but on searching for the error number (-2147217843!), I find nothing online.
I would test the DSN in excel or access then I would check the iis usr has permissions on the sage accdata folder :)

Connection string in Visual Studio for Database Access

My Access database is password: (password is '123')
What is the connection code in C#?
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = #"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\My Project\DB.accdb;user=Admin;pwd=123";
cnn.open();
'ERROR Connection'
The correct connection string for Microsoft Access is something like this
#"Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=G:\My Project\DB.accdb;
Jet OLEDB:Database Password=123;"
Of course you should use the appropriate provider. SqlConnection and the other classes from the namespace System.Data.SqlClient are used for Sql Server. Microsoft Access should uses the classes from the namespace System.Data.OleDb like OleDbConnection, OleDbCommand, OleDbDataReader etc...
This might help you out
Private connString = #"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\My Project\DB.accdb;Jet OLEDB:Database Password=123;"
SqlConnection cnn = new SqlConnection(connString);
cnn.open();
//Do your Work
If you are using Microsoft Access accdb ODBC Driver
Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=G:\mydatabase.accdb;Uid=Admin;Pwd=123;

Resources