Forum Stats

  • 3,815,361 Users
  • 2,259,005 Discussions


What's wrong with these connection strings?

User_ZUZ6N Member Posts: 13 Blue Ribbon

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