stockboy Posted December 4, 2006 Posted December 4, 2006 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
exodius Posted December 4, 2006 Posted December 4, 2006 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
stockboy Posted December 4, 2006 Author Posted December 4, 2006 It's quite simple but I couldn't find it... TNX a lot!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now