Skip to Main Content

Oracle Database Express Edition (XE)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What's wrong with these connection strings?

User_ZUZ6NApr 15 2022 — edited Apr 15 2022

This is in VBScript.
There's some confusion, because Oracle has Users & Schemas, not databases. But the connection strings contain 'Database='. So what do they mean by 'Database' in the context of a connection string?
I'm using the 21c Express Edition. This is the setup:
Oracle Database 21c Express Edition
Multitenant container database: localhost:1521
Pluggable database: localhost:1521/XEPDB1
EM Express URL: https://localhost:9999/em
create user scratchpad identified by XXXXX tablespace users quota unlimited on users ;
grant create session, create table to scratchpad ;

, and this is the code.
Set Oracle_con = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

I've tried many different connection strings. These are 2 of them. Both of them generate an invalid login error. I'm able to connect from other tools, but am just having a problem with the connection string:

ConnectionString_s = "PROVIDER=OraOLEDB.Oracle; dbq=localhost:1521/XE ; Database=SCRATCHPAD ; User Id=scratchpad; Password=XXXXX"
ConnectionString_s = "PROVIDER=OraOLEDB.Oracle; dbq=localhost:1521/XEPDB1 ; Database = SCRATCHPAD ; User Id=scratchpad; Password=XXXXX"
I've also tried connection strings with Data Source=XEPDB1, and SERVER=localhost:1521. But am not able to get the right configuration.
Oracle_con.Open ConnectionString_s

Comments

The connect string goes in the DATASOURCE section I believe and the correct connect string is likely "Data Source=localhost:1521/XEPDB1"

1 - 1

Post Details

Added on Apr 15 2022
1 comment
732 views