Reply
Sat 22 Feb, 2014 08:48 am
Hello
I have a form page on
\\10.20.30.40\project\test\hello\Daily Reports\text.html
and I want to data in .csv format under \\10.20.30.40\project\test\hello\data.csv
but after press the submit button the error mag display
Error: Number:-2146827859 Description:Automation server can't create object
Please help me its urgent for me, I providing you the code of form
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Name</title>
<SCRIPT LANGUAGE='JavaScript'>
function WriteToFile() {
try {
var fso, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.OpenTextFile("d:\\test\\ietm_data.csv" , 8, true, 0);
s.writeline(document.ietmdata.name.value + ", " + document.ietmdata.email.value + ", " +
document.ietmdata.location.value + ", " + document.ietmdata.comments.value + ", " +
document.ietmdata.type.value + ", " + document.ietmdata.problem.value + "," + document.ietmdata.detail.value);
s.Close();
}
catch(err){
var strErr = 'Error:';
strErr += '\nNumber:' + err.number;
strErr += '\nDescription:' + err.description;
document.write(strErr);
}
}
</SCRIPT>
</head>
<BODY>
<form action="test.hta" method="post" name="ietmdata" >
Name: <input type = "text" name="name"><br>
Email: <input type="text" name="email"><br>
Location: <input type = "text" name="location"><br>
Comments: <textarea name="comments"> </textarea><br>
Type: <select name="type" >
<option value="Software"> Software </option>
<option value="Hardware"> Hardware </option>
</select>
<br> <br>
<p> Requesting information:<BR>
<select name="problem">
<option value="Option1"> Option1</option>
<option value="Option2"> Option2</option>
</select> </p>
<p> Requesting Detail:<BR>
<select name="detail">
<option value="Male"> Male</option>
<option value="Female"> Female</option>
</select>
</p> <br> <br> <br>
<INPUT TYPE=BUTTON VALUE="Submit Data to Text File" onClick="WriteToFile(this.form)">
</form>
</body></html>
Thanking You
Manish Kumar