executing sql from vbscript which contains multiple single quotes -


executing above query create new db vbscript. function came with. other sql query work fine this, except this. guess dont know how can make vbscript escape single quotes.

executequery("if  not exists (select name master.dbo.sysdatabases name = 'temp') 

create database temp")

function executequery(query) const db_connect_string = "provider=sqloledb.1;data source=localhost;trusted_connection=true;persist security info=true;integrated security=sspi;"' set myconn = createobject("adodb.connection") set mycommand = createobject("adodb.command" ) myconn.open db_connect_string set mycommand.activeconnection = myconn 'mycommand.commandtext = query mycommand.commandtext = query mycommand.execute myconn.close end function 

'


Comments