Sign in to follow this  
Followers 0
stockboy

Quote problem

4 posts in this topic

In this script I make a connection to an oracle databank (DEV1).

$ado = ObjCreate( "ADODB.Connection" )

With $ado

.ConnectionString =("Provider='OraOLEDB.Oracle';Data Source='DEV1';User Id='x';Password='x';")

.Open

EndWith

I want to replace this DEV1 to a variable.

Something like this (but it's not working - problem with the quotes I guess):

$var =[name databank]

$ado = ObjCreate( "ADODB.Connection" )

With $ado

.ConnectionString =("Provider='OraOLEDB.Oracle';Data Source=$var;User Id='x';Password='x';")

.Open

EndWith

Anybody?

TNX

Share this post


Link to post
Share on other sites



Use an Ampersand (&) to concatenate your variables into strings.

$var =[name databank]
$ado = ObjCreate( "ADODB.Connection" )
With $ado
.ConnectionString =("Provider='OraOLEDB.Oracle';Data Source=" & $var & ";User Id='x';Password='x';")
.Open
EndWith

Share this post


Link to post
Share on other sites

It's quite simple but I couldn't find it...

TNX a lot!

Share this post


Link to post
Share on other sites

No prob, it's just one of those things. ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0