I am trying to write an insert query like this -
Database.ExecSQL("INSERT INTO wf_GiftForms (Vendor, Form, scannedindex, SubmitDate, Total, LinkIndex, Acct, Name, Amnt, Mailing1, Mailing2, Mailing3, Mailing4, USERID, SpecialInstructions) VALUES ('" + Name.rawValue + "', 'QPQs', '" + MaxIndex.rawValue + "', '" + SubmitDate.rawValue + "', '" + string3 + "', '" + string4 + "', '" + Advance_Account_Number.rawValue + "', '" + Advance_Account_Name.rawValue + "', '" + string3 + "', '" + Street.rawValue + "', '" + City.rawValue + "', '" + State1.rawValue + "', '" + Zip.rawValue + "', '" + EmailAddress.rawValue + "', '" + Special_Gift_Instructions_2.rawValue + "');");
I am trying to take inputs entered in the pdf form and insert it to a table in SQL Server.
The problem comes when I use quotations(' and "") in any of the fields - Say I use name (here Vendor) as John's then the query fails to insert. Any comments? I am using Adobe Live cycle designer and Javascript.
Looking for someone who can help me..
Thanks,
kaushik
Database.ExecSQL("INSERT INTO wf_GiftForms (Vendor, Form, scannedindex, SubmitDate, Total, LinkIndex, Acct, Name, Amnt, Mailing1, Mailing2, Mailing3, Mailing4, USERID, SpecialInstructions) VALUES (\"'\" + Name.rawValue + \"'\", 'QPQs', \"'\" + MaxIndex.rawValue + \"'\", \"'\" + SubmitDate.rawValue + \"'\", \"'\" + string3 + \"'\", \"'\" + string4 + \"'\", \"'\" + Advance_Account_Number.rawValue + \"'\", \"'\" + Advance_Account_Name.rawValue + \"'", \"'\" + string3 \"'\", \"'\" + Street.rawValue + \"'\", \"'\" + City.rawValue + \"'\", \"'\" + State1.rawValue + \"'\", \"'\" + Zip.rawValue + \"'\", \"'\" + EmailAddress.rawValue + \"'\", \"'\" + Special_Gift_Instructions_2.rawValue + \"'\");");
George Kaiser