stockboy Posted December 4, 2006 Share 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 Link to comment Share on other sites More sharing options...
exodius Posted December 4, 2006 Share 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 Link to comment Share on other sites More sharing options...
stockboy Posted December 4, 2006 Author Share Posted December 4, 2006 It's quite simple but I couldn't find it... TNX a lot! Link to comment Share on other sites More sharing options...
exodius Posted December 4, 2006 Share Posted December 4, 2006 No prob, it's just one of those things. Link to comment Share on other sites More sharing options...
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