esthera
02-16-2005, 07:16 AM
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument
/admin.asp, line 167
I am getting this error when trying to MyFile.writeline strLine when the actual value of strline is in hebrew. (it works in english.)
below is the actual code. I did declare my session.codepage=1255
This only happens when there is hebrew in the database -- not english.
Please help me debug
sub outputexcel(sql)
'response.write sql
randomize
nRandom = (100-1)*Rnd+1
fileExcel =monthname(month(date)) & cstr(year(date)) & "_" & CStr(nRandom) & ".xls"
filePath= Server.mapPath("admin.asp")
filepath=mid(filepath,1,len(filepath)-9)
'response.write "filepath:" & filepath & "<br>"
filename=filePath & "excelfiles\" & fileExcel
'response.write filename
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set MyFile = fs.CreateTextFile(filename, True)
Set rs = objconn.Execute(sql)
strLine="<table><tr>" 'Initialize the variable for storing the filednames
For each x in rs.fields
strLine= strLine & "<td>" & x.name & "</td>"
Next
strline=strline&"</tr>"
MyFile.writeline strLine
Do while Not rs.EOF
strLine="<tr>"
for each x in rs.Fields
cell=x.value
strLine= strLine & "<td>" & cell & "</td>"
next
strline=strline & "</tr>"
MyFile.writeline strLine
rs.MoveNext
Loop
myfile.writeline "</table>"
MyFile.Close
Set MyFile=Nothing
Set fs=Nothing
link="<A HREF=excelfiles/" & fileExcel & " class=adminmenu target=_new>Click Here to Open Excel</a> or right click to save target file"
Response.write "<br>Excel File Created<br><br>" & link
end sub
Invalid procedure call or argument
/admin.asp, line 167
I am getting this error when trying to MyFile.writeline strLine when the actual value of strline is in hebrew. (it works in english.)
below is the actual code. I did declare my session.codepage=1255
This only happens when there is hebrew in the database -- not english.
Please help me debug
sub outputexcel(sql)
'response.write sql
randomize
nRandom = (100-1)*Rnd+1
fileExcel =monthname(month(date)) & cstr(year(date)) & "_" & CStr(nRandom) & ".xls"
filePath= Server.mapPath("admin.asp")
filepath=mid(filepath,1,len(filepath)-9)
'response.write "filepath:" & filepath & "<br>"
filename=filePath & "excelfiles\" & fileExcel
'response.write filename
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set MyFile = fs.CreateTextFile(filename, True)
Set rs = objconn.Execute(sql)
strLine="<table><tr>" 'Initialize the variable for storing the filednames
For each x in rs.fields
strLine= strLine & "<td>" & x.name & "</td>"
Next
strline=strline&"</tr>"
MyFile.writeline strLine
Do while Not rs.EOF
strLine="<tr>"
for each x in rs.Fields
cell=x.value
strLine= strLine & "<td>" & cell & "</td>"
next
strline=strline & "</tr>"
MyFile.writeline strLine
rs.MoveNext
Loop
myfile.writeline "</table>"
MyFile.Close
Set MyFile=Nothing
Set fs=Nothing
link="<A HREF=excelfiles/" & fileExcel & " class=adminmenu target=_new>Click Here to Open Excel</a> or right click to save target file"
Response.write "<br>Excel File Created<br><br>" & link
end sub