This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Error connecting Oracle ADO database
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 12, 2011
09:44 AM
Error connecting Oracle ADO database
I have a Basic MSI project and I'm trying to run an InstallScript function that connects to an Oracle 11g database to see if the user provided the correct credentials. But I always get back the error message "Oracle Error 1017:ORA-01017: invalid username/password:logon denied".
Here is the code for my function:
I believe it's making the connection, because if I change the provider name it gives a different error about not being able to find the provider. But for some reason it won't validate my login, even though I'm giving it the correct password. I've tried with both the SYS and SYSTEM users.
Anyone have any idea on why this isn't working?
Here is the code for my function:
function MyADODBTest()
OBJECT objConnection;
STRING strConnection;
BOOL bResult;
STRING strUserName;
STRING strPassword;
STRING strDatabase;
STRING strFieldName;
STRING strError;
begin
bResult = FALSE;
strError = "";
strProvider = "OraOLEDB.Oracle";
strUserName = "SYS";
strPassword = "password";
strDatabase = "MyDatabase";
///////////////////////////////////////////////////////////////////////////
// Build Connection String //
///////////////////////////////////////////////////////////////////////////
strConnection = "Provider=" + strProvider + ";";
strConnection = strConnection + "User ID=" + strUserName + ";";
strConnection = strConnection + "Password=" + strPassword + ";";
strConnection = strConnection + "Data Source=" + strDatabase;
///////////////////////////////////////////////////////////////////////////
// Open and Retreive SQL Server Version //
///////////////////////////////////////////////////////////////////////////
try
set objConnection = CreateObject("ADODB.Connection");
if (IsObject(objConnection)) then
objConnection.ConnectionString = strConnection;
objConnection.Open;
bResult = TRUE;
endif;
set objConnection = NOTHING;
catch
set objConnection = NOTHING;
strError = Err.Description;
endcatch;
if (!bResult) then
MessageBox(strError, INFORMATION);
endif;
return (bResult);
end;
I believe it's making the connection, because if I change the provider name it gives a different error about not being able to find the provider. But for some reason it won't validate my login, even though I'm giving it the correct password. I've tried with both the SYS and SYSTEM users.
Anyone have any idea on why this isn't working?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 12, 2011
11:53 AM
Have you tried to login as SYSDBA? For the Oracle Provider for OLE DB, you need to specify "AS SYSDBA" after your password in the Password attribute, such as "Password=mypwd AS SYSDBA".
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 16, 2011
11:31 AM
No luck. I've tried SYS and SYSTEM and still get the same invalid password error. Here is my connection string which I log right before executing:
Provider=OraOLEDB.Oracle;User ID=SYS;Password=password AS SYSDBA;Data Source=MyDatabase
I assume since it's returning the invalid password error that I have the connection string correct and it is attempting to make the connection? I really have no idea where to go on this one. Any help?
Provider=OraOLEDB.Oracle;User ID=SYS;Password=password AS SYSDBA;Data Source=MyDatabase
I assume since it's returning the invalid password error that I have the connection string correct and it is attempting to make the connection? I really have no idea where to go on this one. Any help?