?
Solved

VBScript runtime (0x800A000D) & Server.URLEncode error!

Posted on 2001-07-19
16
Medium Priority
?
992 Views
Last Modified: 2011-10-03
hai, i have a bunck of data which is imported into access table. some of the field of the existing data is empty. when i try to the data from a page to another one by using 'Server.URLEncode' but it gives error.

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'Server.URLEncode'
/aaa/bbb/ccc/ccc.asp, line 148


line 148
myfile = "ddd.asp?mode=" & Server.URLEncode("update") & "&sID=" & Server.URLEncode(sID) & "&sName=" & Server.URLEncode(sName) & "&sLength=" & Server.URLEncode(sLength) & "&sPrdId=" & Server.URLEncode(sPrdId) & "&sL=" & Server.URLEncode(sL) & "&sC=" & Server.URLEncode(sC)

response.redirect(myfile)          

In the table(imported from excel) the fields: sL  and sC is an empty field. both allow zero length data.
somehow, when i insert a new record(not imported data) with empty field for sL and sC. it dun give error as above although the sL and SC is empty.

does anyone has any idea? ur help will much appreciated! thanks a lot!
0
Comment
Question by:khongkham
  • 7
  • 4
  • 2
  • +2
16 Comments
 
LVL 8

Expert Comment

by:drittich
ID: 6300805
Server.URLEncode( takes a string as a parameter, so if sID, sPrdId, etc. are numbers, that would cause a problem.
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6300810
drittich is correct. If it is an integer, then you should not need to have that.

hongjun
0
 

Author Comment

by:khongkham
ID: 6300844
nope, sC and sL are both text field. would it b'coz after imported the existing data from excel to access that the empty fields (sC and sL) has contained some special character that can't be visiblly seen??? maybe, something like \n??? but, i used response.write. to display the data for sC and sL nothing is shown!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 33

Expert Comment

by:hongjun
ID: 6300865
Try doing a response.write on those variables.

hongjun
0
 

Author Comment

by:khongkham
ID: 6300886
these are the result:

sName:MANASAEY MANASAEY
sLength:5.31
sC:
sL:s
sPrdId:22

no data contained for sC (this is an existing record, imported from excel)
0
 
LVL 8

Expert Comment

by:drittich
ID: 6300912
is sPrdId a string or number?
0
 

Author Comment

by:khongkham
ID: 6300919
sPrdId is a number
0
 

Author Comment

by:khongkham
ID: 6300925
hai, i had tested... change sPrdId to a text field but it still give the same error!!
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6300942
Try this
Server.URLEncode(CStr(sPrdId))

hongjun
0
 
LVL 20

Accepted Solution

by:
Michel Sakr earned 120 total points
ID: 6301001
Possible when a data is null it will throw the error but if the data is empty it won't.. Null is not the same as empty.. null is undefined.. so my advice either always store a value (by defining a default value in the db) where you know if this value shows up then no data is entered or check the recordset field value before using it using the function ISNULL()
0
 
LVL 7

Expert Comment

by:weesiong
ID: 6301012
Silvers5 is correct :)

Regards,
Wee Siong
0
 

Author Comment

by:khongkham
ID: 6301049
hai, if i want to se the default valu in access table how to set it?
0
 

Author Comment

by:khongkham
ID: 6301054
sorry, i actuall want to find out how to use the ISNYLL() in the recordset. could u give me a simple example.


thanks!
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6301055
There is a default property for all fields. Make sure that you are in design mode. Click the field and then change the default property. By default, it is empty.

hongjun
0
 
LVL 20

Expert Comment

by:Michel Sakr
ID: 6301080
If ISNULL(rs("fieldName")) then
'field is null event error will show up here
else
'do as usual
end if


isnull returns a boolean value (true/false)
0
 

Author Comment

by:khongkham
ID: 6301217
thanks, it really solve my problem!!!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question