send parameters in Delete Query
Hello
Thank you in advance for your kind assistance
I have a problem in Delete Query, when I 'm gonna use varaiable in Delete Query instead of hard code, like this code, what shall I do??
function Delete()
{
var AConnection, Driver;
AConnection = ADO.CreateADOConnection();
AConnection.ConnectionString = "Provider=MSDAORA.1;Password=autocm931;User ID=autocm931;Data Source=srv28;Persist Security Info=True";
AConnection.LoginPrompt = false;
AConnection.Open();
var Driver = DDT.ExcelDriver("C:\\Add-Exchange.xls", "Sheet1");
var k = Driver.Value(0);
AConnection.Execute_("delete from exchange ex where ex.name like k"); // this line has error, because of variable k
DDT.CloseDriver(Driver.Name);
AConnection.Close();
}
yes, my problem was solved like this :
function Delete()
{
var AConnection, Driver;
AConnection = ADO.CreateADOConnection();
AConnection.ConnectionString = "Provider=MSDAORA.1;Password=autocm931;User ID=autocm931;Data Source=srv28;Persist Security Info=True";
AConnection.LoginPrompt = false;
AConnection.Open();
var Driver = DDT.ExcelDriver("C:\\Add-Exchange.xls", "Sheet1");
var k = aqConvert.VarToStr(Driver.Value(0));
var str = "delete from exchange ex where ex.name like '"+k+"'"
AConnection.Execute_(str);
DDT.CloseDriver(Driver.Name);
AConnection.Close();}
Thanks for ur consideration