Unknown provider name 'OraOLEDB.Oracle.1' Parameter name error - sql

What do I need to download to resolve this error?
edit:
I've got the following connection string on an application that requires a connection string o connect to the database
Provider=OraOLEDB.Oracle.1;Password=pass;Persist Security Info=True;User ID=username;Data Source=db;PLSQLRSet=1
when I try to retrieve colmns for a data table I get that error

Are you on windows? If so open the "ODBC Data Source Administrator" in win 7 or go to Control Panel -> Administrative Tools -> Data Sources (ODBC) and go to the "Drivers" tab, check that the name attribute of the list matches with the "Provider" in the connection string.
Ex. connection string: Provider=OraOLEDB.Oracle.1
In the drivers list: Name=OraOLEDB.Oracle.1 Version=xxx

Related

SQL - Another "SELECT Permission was denied on the object" Issue

(I know SO has well over a dozen questions with the same/similar title and I promise I've already gone through every one of them to no avail. I might have missed one or two minor details but I suspect my problem could be something more deep rooted. Enough said for intro)
Anyway, I have a database (let's call it FooDB) that I restored from a backup database. I can do whatever I want with it using SQL Server 2012 Management Studio, including SELECT, INSERT, or DELETE on any of the record, columns, or tables.
What I'm having trouble with is when I try to run a simple query against the same database, I get the following error:
An error has occurred.","ExceptionMessage":"The SELECT permission was denied on the object 'BarTable', database 'FooDB', schema 'dbo'."
There's a lot more to the stack trace but I won't post it here unless necessary. I'm using Visual Studio 2012 Ultimate and in one of the class files I specified the connection string as follows:
using (SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;" +
"Initial Catalog=FooDB;" +
"Integrated Security=true;"))
{
con.Open();
using (SqlCommand command = new SqlCommand("SELECT TOP 3 * FROM BarTable", con))
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
... // code in this block is not shown as it is irrelevant to the issue
}
}
}
Heeding to various suggestions I came across on SO, I tried the following:
In SQL Server Management Studio, I selected 'Security' -> 'Logins' -> Right-click on the Windows login name and open the 'Properties' dialog -> In 'Server Roles' page, I selected dbcreator, public, serveradmin, setupadmin, and sysadmin
While on the same 'Properties' dialog from above, I selected 'User Mapping' page, then checked the 'Map' checkbox for the database (FooDB), and assigned the following database role membership: db_accessadmin, db_backupoperator, db_datareader, db_datawriter, db_ddladmin, db_owner, db_securityadmin, and public
From the Object Explorer of the Server Management Studio, I selected 'Databases' -> 'FooDB' -> 'Security' -> 'Users' -> Then I right-clicked the Windows login name and selected 'Properties' to open the 'Database User' dialog. Then I selected 'Owned Schemas' page and checked db_backupoperator, db_datareader, and db_datawriter
While on the same dialog from above, I selected 'Membership' page, and checked db_accessadmin, db_backupoperator, db_datareader, db_datawriter, db_ddladmin, db_owner, and db_securityadmin
That's all I can think of at this moment. Again, from within the SQL Server Management Studio (after logging in with the same Windows Authentication and server name) I can do whatever I want to with the database. But from within my C# class, it seems I can connect to the database but I lack the privilege to perform any action.
This is something I've been wrestling with unsuccessfully for almost a week. What gives?
Is the server authentication set to SQL server and Windows Authentication mode?
To do so, right click on the SQLServer -> properties -> security.
Edit: Dint mean database, did mean the SqlServer
Have you tried running sp_change_users_login .
Sometimes when you restore a DB it creates new sid (security ids) for the users. When it does that, the DB user and the Server login look the same, but internally the sids don't match. sp_change_users_login will fix that.
Details on how to use the stored procedure can be found here:
https://msdn.microsoft.com/en-us/library/ms174378.aspx
Try this initially - you will have to edit it slightly to fit your user and login name:
EXEC sp_change_users_login 'update_one', 'YourDBUserName', 'YourServerLoginName';

Can I access an encrypted SQL Server Compact database in Excel VBA?

I want to access an encrypted SQL Server Compact Edition database via VBA. I can access the database fine when it is not encrypted, but the code breaks when I try to use a password:
pConn.ConnectionString = "PROVIDER=Microsoft.SQLSERVER.CE.OLEDB.3.5;Password=[my_password];Data Source=" & SdfPath
I've been following the connection string example provided here for SQL Server Compact with a password:
Encryption enabled
Use this connection string to enable encryption on the database.
Data Source=MyData.sdf;Encrypt Database=True;Password=myPassword;
File Mode=shared read;Persist Security Info=False;
The Encrypt Database="True" pair is really not necessary as the presence of the Password-parameter itself turns on encryption for the connection.
But why doesn't this work in Excel VBA 2010?
Apparently, the connection string example in the site I was using is incorrect. I found the correct connection string example from Microsoft:
Using Microsoft ActiveX® Data Objects for Windows CE (ADOCE), Microsoft ActiveX Data Objects Extensions for Data Definition Language (DDL) and Security (ADOXCE), or the Replication object
To create a password-protected database using the either the ADOCE or ADOXCE Catalog object, or the AddSubscription method of the SQL Server CE Replication ActiveX object, you must specify the provider-specific SSCE:Database Password connection property in the connection string. For example:
"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; data source=\NorthWind.sdf; SSCE:Database Password=[myPassword]"
And so now my code is:
pConn.ConnectionString = "PROVIDER=Microsoft.SQLSERVER.CE.OLEDB.3.5;SSCE:Database Password=[my_password];Data Source=" & SdfPath
This worked perfectly for me.
If you have SQL Server Compact 4.0 installed and use "Microsoft.SQLSERVER.CE.OLEDB.2.0" or "Microsoft.SQLSERVER.CE.OLEDB.3.5" as provider in connection string, you will get an error mentioning provider not found. Change connection string to reflect to "Microsoft.SQLSERVER.CE.OLEDB.4.0".

ASP, DSN-Less connection, connection string syntax gives Data source name not found error

This is the error message
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified
/Ute/ute_class.inc, line 1357
This is my Ute.ASP code
Dim sDSN
sDSN = "Data Source=MYSERV0000\PSAPP01; Initial Catalog=LibraryDB; User Id=admsa; password=sa"
P.S: I am able to use the same string within my web.config, with .net 4.0
Side comment ... don't use .inc files. Very bad practice ... if you have an error on the page it may provide the name of your .inc that has your database connection. Since the .inc page is not an .asp, if someone types in the URL for that .inc it will just come back as plain text. WHAM ... visitor now has your connection string. Convert it to an .asp and your problems are over.
As far as the Connection String, there's too many possibilities to answer precisely so I'll just point you in the direction of http://connectionstrings.com/ Follow the right links and it should give you a template of what your connection string should be.
sDSN = "Provider=SQLNCLI;Server=SERVER\INSTANCE;Database=exampleDB;Uid=admsa; Pwd=sa;" makes it work

Oracle database connection string PLSQL compatibility

I'm using an application called Logi info. it requires a connection string to my oracle database. the connection works fine but in order to configure the connection to recive ref cursors from the database, I apparently need to add PLSQLRSet=1 to the end of the string. when I do that I recieve an error "invalid connection string"
Here is my connection string without plsqlrset=1
Data Source=SID; User Id=username; Password=password;
My concern is that PLSQLRSet=1 might be .NET paramater only. Can anyone shed some light on the issue.
Thanks
It appears that the PLSQLRset option is a feature of the OraOLEDB provider (per http://download.oracle.com/docs/cd/B10501_01/win.920/a95498/using.htm).
Therefore I would guess that you have to add Provider=OraOLEDB.Oracle to the connect string -- as shown in the screenshot on the page you linked to -- in order to use this option.

command line to create data source with sql authentication?

I'm looking to run a batch file on windows xp professional which creates a system odbc data source for a sql server connection. I can do that with:
ODBCCONF.exe CONFIGSYSDSN "SQL Server" "DSN=Kappa| Description=Kappa Data Source | SERVER=10.100.1.10 | Trusted_Connection=Yes | Database=subscribers"
However I need a way to set the sql server authentication to be "With SQL Server authentication using a login ID and password entered by the user." to be set and preset the login id and pass.
Any ideas on how to do this?
thanks in advance
I hope this helps someone, i found that i could not store the username and password. However, I was able to make a ODBC connection without those. The problem was that the connection kept returning an error about how it could not locate the data source name or driver. Only after I removed the spaces from the attribute string could my programs use the odbc connection.
So
ODBCCONF.exe /a { CONFIGSYSDSN "SQL Server" "DSN=dsnname | SERVER=yourservername | Database=Finance"}
should become
ODBCCONF.exe /a { CONFIGSYSDSN "SQL Server" "DSN=dsnname|SERVER=yourservername|Database=Finance"}
create a .reg file with the parameters and merge it in with regedit.exe
Tip: export an existing ODBC profile from the registry to help get the syntax and field names correct
ODBCConf ConfigSysDSN "SQL Server" "DSN=xxxxx|SERVER=yyyyy|Trusted_Connection=No"
seemed to work for me.
You create the DSN the same way for both trusted and non trusted. It is when you use the ODBC connection string that you specify that you want to use trusted connections.
DsnString = "ODBC;DSN=Kappa;Database=MyDBName;Integrated Security=SSPI;Trusted_Connection=True"