Click here to Skip to main content
15,906,625 members
Home / Discussions / Java
   

Java

 
GeneralI am getting the error when I try to execute a Query. Error retrieving data:1 java.sql.SQLException: [Macromedia][Oracle JDBC Driver]Value can not be converted to requested type.Exception in DBAccessor:formatResults java.sql.SQLException: [Macromedia Pin
ummadu5-Jun-09 10:40
ummadu5-Jun-09 10:40 
GeneralError getting column type Pin
fly9047-Jun-09 10:41
fly9047-Jun-09 10:41 
Questionclient server communication Pin
dumnbncool5-Jun-09 7:21
dumnbncool5-Jun-09 7:21 
QuestionBackground dimmer Pin
EnchantedSun5-Jun-09 3:56
EnchantedSun5-Jun-09 3:56 
QuestionProblem with JSObject Pin
raesa5-Jun-09 2:44
raesa5-Jun-09 2:44 
QuestionJava Swing - Right Click and JPopupMenu in JTable Pin
djDash5-Jun-09 0:25
djDash5-Jun-09 0:25 
QuestionRe: Java Swing - Right Click and JPopupMenu in JTable Pin
Java John11-Jun-09 1:59
Java John11-Jun-09 1:59 
QuestionCreating a file and saving it on a networked computer [modified] Pin
ItIsFinished4-Jun-09 12:00
ItIsFinished4-Jun-09 12:00 
I have a little snippet of code that writes a little text file locally by calling the script through Javascript on a web page. It works fine. Here is the example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Local File Create Script</title>
</head>

<body>
<script>
function WriteToFile()
{
  try 
  {
    var fso, s;
	fso = new ActiveXObject("Scripting.FileSystemObject");
	s = fso.CreateTextFile("C:\\test.txt", true);
    s.writeline("This is a test");
	s.writeline("Oh Yea!!!!");
    s.Close();
  } 
  catch(err)
  {
   var strErr = 'Error:';
   strErr += '\nNumber:' + err.number;
   strErr += '\nDescription:' + err.description;
   document.write(strErr);
  }
}
</script>

<input name="write_to_file" type="button" id="write_to_file" onClick="WriteToFile()" value="Click Here" />
</body>

</html>

Now , what I would like to do is create that file on another computer by ip address. Here is what I got so far:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Network File Create Script</title>
</head>

<body>
<script>
function WriteToFile()
{
  try 
  {
    var fso, sDir, s;
	fso = new Server.CreateObject("Scripting.FileSystemObject");
	sDir = fso.GetFolder("\\10.6.3.45\c$", true);
	s = fso.CreateTextFile("\test.txt", true);
    s.writeline("This is a test");
	s.writeline("Oh Yea!!!!");
    s.Close();
  } 
  catch(err)
  {
   var strErr = 'Error:';
   strErr += '\nNumber:' + err.number;
   strErr += '\nDescription:' + err.description;
   document.write(strErr);
  }
}
</script>

<input name="write_to_file" type="button" id="write_to_file" onClick="WriteToFile()" value="Click Here" />
</body>

</html>

Here is the error I am getting:
Error: Number:-2146823279 Description:'Server' is undefined

Can anyone help me?

modified on Thursday, June 4, 2009 6:27 PM

AnswerRe: Creating a file and saving it on a networked computer [modified] Pin
darkdragn5-Jun-09 2:45
darkdragn5-Jun-09 2:45 
GeneralRe: Creating a file and saving it on a networked computer Pin
ItIsFinished5-Jun-09 5:44
ItIsFinished5-Jun-09 5:44 
QuestionWriting a simple HTML report using Java Pin
raesa3-Jun-09 20:15
raesa3-Jun-09 20:15 
AnswerRe: Writing a simple HTML report using Java Pin
Ali Shakiba10-Jun-09 22:19
Ali Shakiba10-Jun-09 22:19 
Questionneed help geeting a nullpointerexeption [modified] Pin
ashish_bhatia3-Jun-09 1:07
ashish_bhatia3-Jun-09 1:07 
AnswerRe: need help geeting a nullpointerexeption Pin
Nagy Vilmos3-Jun-09 2:00
professionalNagy Vilmos3-Jun-09 2:00 
RantRe: need help geeting a nullpointerexeption [modified] Pin
ItIsFinished4-Jun-09 12:13
ItIsFinished4-Jun-09 12:13 
GeneralRe: need help geeting a nullpointerexeption Pin
Nagy Vilmos5-Jun-09 3:46
professionalNagy Vilmos5-Jun-09 3:46 
QuestionMobile Application Pin
cdpace2-Jun-09 23:40
cdpace2-Jun-09 23:40 
AnswerRe: Mobile Application Pin
Nagy Vilmos3-Jun-09 0:08
professionalNagy Vilmos3-Jun-09 0:08 
Questionretrieving selected item from jComboBox in jTable Pin
Denis J. González1-Jun-09 9:16
Denis J. González1-Jun-09 9:16 
AnswerRe: retrieving selected item from jComboBox in jTable Pin
darkdragn1-Jun-09 9:25
darkdragn1-Jun-09 9:25 
GeneralRe: retrieving selected item from jComboBox in jTable Pin
Denis J. González1-Jun-09 9:43
Denis J. González1-Jun-09 9:43 
QuestionMobile Programming Pin
Sourie30-May-09 19:28
Sourie30-May-09 19:28 
AnswerRe: Mobile Programming Pin
raheela12331-May-09 1:22
raheela12331-May-09 1:22 
Questionproblem in do-while loop Pin
kenna18030-May-09 4:58
kenna18030-May-09 4:58 
AnswerRe: problem in do-while loop Pin
raheela12331-May-09 1:15
raheela12331-May-09 1:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.