Help... (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


sssngt83 -> Help... (10/8/2007 21:45:47)

I want save the data i keyin in database but got this error.

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'ConvertS'
/sinheng/process.asp, line 15

<%
companyname=Request.Form("company")
contactperson=Request.Form("contact")
address=Request.Form("address")
country=Request.Form("country")
postalcode=Request.Form("postalcode")
contactno=Request.Form("tel")
faxno=Request.Form("fax")
email=Request.Form("email")
enquiry=Request.Form("description")


Sub InsertPurchaseDetails

SQLInsert = "insert into tblPurchase (cname,cperson,address,country,postalcode,tel,faxno,email,description) " &_
" values (" &_
"'"& ConvertS(companyname) &"'," &_
"'"& ConvertS(contactperson) &"'," &_
"'"& ConvertS(address) &"'," &_
"'"& ConvertS(country) &"'," &_
"'"& ConvertS(postalcode) &"'," &_
"'"& ConvertS(contactno) &"'," &_
"'"& ConvertS(faxno) &"'," &_
"'"& ConvertS(email) &"'," &_
"'"& ConvertS(enquiry) &"'" &_
" )"

Conn.Execute SQLInsert


End Sub
%>

Any ideas ??
Thx....




William Lee -> RE: Help... (10/8/2007 21:58:22)


quote:

ORIGINAL: sssngt83

I want save the data i keyin in database but got this error.

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'ConvertS'
/sinheng/process.asp, line 15



You are just showing snippets of your code listing, exactly what is line 15?




sssngt83 -> RE: Help... (10/8/2007 22:00:33)

sorry, forget mention it...
Line 15 is
SQLInsert = "insert into tblPurchase (cname,cperson,address,country,postalcode,tel,faxno,email,description) " &_




William Lee -> RE: Help... (10/8/2007 22:03:54)


quote:

ORIGINAL: sssngt83

sorry, forget mention it...
Line 15 is
SQLInsert = "insert into tblPurchase (cname,cperson,address,country,postalcode,tel,faxno,email,description) " &_



Alright, what is ConvertS? Is it a function? I don't see ConvertS in the code you posted.




sssngt83 -> RE: Help... (10/8/2007 22:13:48)

I got show at post .... actually i just start learning asp, so not really know about it.




William Lee -> RE: Help... (10/8/2007 22:21:56)


quote:

ORIGINAL: sssngt83

I got show at post .... actually i just start learning asp, so not really know about it.


Welcome and take your time to learn here. Lots of help here.

So can you tell me what does ConvertS do?
Did you declare it as a variable somewhere?






sssngt83 -> RE: Help... (10/8/2007 23:43:42)

actually i doing a form when user keyin data then will save to database. inside form got that information. Then i go see example they use like that, i dun know how to declare it ?? or any suggestion use other method ??




William Lee -> RE: Help... (10/8/2007 23:47:38)


quote:

ORIGINAL: sssngt83


Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'ConvertS'
/sinheng/process.asp, line 15



The error is about this ConvertS. This is maybe a function or a subroutine and probably has been declared somewhere in other .asp pages.

If you can find out what it is, you are closer to solving your problem.




William Lee -> RE: Help... (10/8/2007 23:52:28)

quote:

ORIGINAL: sssngt83




Sub InsertPurchaseDetails

SQLInsert = "insert into tblPurchase (cname,cperson,address,country,postalcode,tel,faxno,email,description) " &_
" values (" &_
"'"& ConvertS(companyname) &"'," &_
"'"& ConvertS(contactperson) &"'," &_
"'"& ConvertS(address) &"'," &_
"'"& ConvertS(country) &"'," &_
"'"& ConvertS(postalcode) &"'," &_
"'"& ConvertS(contactno) &"'," &_
"'"& ConvertS(faxno) &"'," &_
"'"& ConvertS(email) &"'," &_
"'"& ConvertS(enquiry) &"'" &_
" )"

Conn.Execute SQLInsert


End Sub
%>

Any ideas ??
Thx....


Another way is to remove the ConvertS altogether and test your script, like this:

SQLInsert = "insert into tblPurchase (cname,cperson,address,country,postalcode,tel,faxno,email,description) " &_
" values (" &_
"'"& (companyname) &"'," &_
"'"& (contactperson) &"'," &_
"'"& (address) &"'," &_
"'"& (country) &"'," &_
"'"& (postalcode) &"'," &_
"'"& (contactno) &"'," &_
"'"& (faxno) &"'," &_
"'"& (email) &"'," &_
"'"& (enquiry) &"'" &_
" )"

You will probably meet with another error, but that will help you to know better.




sssngt83 -> RE: Help... (10/8/2007 23:56:47)

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Conn'

This line error "Conn.Execute SQLInsert "




William Lee -> RE: Help... (10/8/2007 23:59:20)


quote:

ORIGINAL: sssngt83

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Conn'

This line error "Conn.Execute SQLInsert "


I ask you again, is that all the code you have in your .asp page?
Can you post the rest?

Where is your declare statements?




sssngt83 -> RE: Help... (10/9/2007 0:03:06)

This is all the code

<%
companyname=Request.Form("company")
contactperson=Request.Form("contact")
address=Request.Form("address")
country=Request.Form("country")
postalcode=Request.Form("postalcode")
contactno=Request.Form("tel")
faxno=Request.Form("fax")
email=Request.Form("email")
enquiry=Request.Form("description")


Sub InsertPurchaseDetails

	SQLInsert = "insert into tblPurchase (cname,cperson,address,country,postalcode,tel,faxno,email,description) " &_
      		" values (" &_
			"'"& ConvertS(companyname) &"',"	&_
			"'"& ConvertS(contactperson) &"',"	&_
			"'"& ConvertS(address) &"',"	&_
			"'"& ConvertS(country) &"',"	&_
			"'"& ConvertS(postalcode) &"',"	&_
			"'"& ConvertS(contactno) &"',"	&_
			"'"& ConvertS(faxno) &"',"	&_
			"'"& ConvertS(email) &"',"	&_
			"'"& ConvertS(enquiry) &"'"	&_
			" )"
		'response.write sqlinsert
		'response.end
		Conn.Execute SQLInsert
		
	
End Sub
%>
<%
	InsertPurchaseDetails
	'SendMail()
 	'Response.Redirect("confirmation.htm")
%>
<%
 	
Sub SendMail()

	Name=Request.form("txtname")
	Address=Request.form("txtaddress")
	Telephonenumber=Request.form("txttelephoneno")
	EmailAddress=Request.form("txtemailadd")
	Comment=Request.form("txtcomment")
	
	set myobjMail = Server.CreateObject("CDONTS.NewMail")
	myObjMail.mailFormat=0
	myObjMail.BodyFormat=0
	
	'Dim mySmartMail
	'Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail")
	
	'mySmartMail.Server = "202.172.244.181"
	'mySmartMail.Server = "mail.akyweb.com"
	'mySmartMail.ContentType = "text/html"
	'mySmartMail.Charset = "ISO-8859-1"

	body = "<style type=""text/css"">"
	body = body & "<!--"
	body = body & ".pagebg {	background-color: white;		background-repeat: repeat-x;	background-position: center top;}.pagebg2 {	background-color: F5CB14;		background-repeat: repeat-x;	background-position: left top;}.purple {	background-color: A11E61;		background-repeat: no-repeat;	background-position: right bottom;}.yellow {	background-color: FFD34B;		background-repeat: no-repeat;	background-position: right bottom;}.adsr {		background-repeat: repeat-y;	background-position: right top;}.dot {		background-repeat: repeat-y;	background-position: center top;}.arial11 {	font-family: Arial;	font-size: 11px;}.arial10 {	font-family: Arial;	font-size: 10px;}.arail11bold {	font-family: Arial;	font-size: 11px;	font-weight: bold;}.arail15bold {	font-family: Arial;	font-size: 15px;	font-weight: bold;}.arial12bold {	font-family: Arial;	font-size: 12px;	font-weight: bold;}.verdana12bold {	font-family: Verdana;	font-size: 12px;	font-weight: bold;}.verdana11bold {	font-family: Verdana;	font-size: 11px;	font-weight: bold;}.verdana11{	font-family: Verdana;	font-size: 11px;	}.verdana10{	font-family: Verdana;	font-size: 10px;	}A:link { text-decoration: none; color: #ffffff; }A:visited {text-decoration: none; color: #ffffff; }A:hover {text-decoration: none; color: #FF7A2E; }A:active {text-decoration: none; color: #ffffff; }A.s1:link { text-decoration: none; color: #3B1E00; }A.s1:visited {text-decoration: none; color: #3B1E00; }A.s1:hover {text-decoration: none; color: #ffffff; }A.s1:active {text-decoration: none; color: #3B1E00; }A.s2:link { text-decoration: none; color: #ffffff; }A.s2:visited {text-decoration: none; color: #ffffff; }A.s2:hover {text-decoration: none; color: #3B1E00; }A.s2:active {text-decoration: none; color: #ffffff; }A.s3:link { text-decoration: none; color: #434141; }A.s3:visited {text-decoration: none; color: #434141; }A.s3:hover {text-decoration: none; color: #BD2F13; }A.s3:active {text-decoration: none; color: #434141; }A.s4:link { text-decoration: underline; color: #808080; }A.s4:visited {text-decoration: underline; color: #808080; }A.s4:hover {text-decoration: underline; color: #2F6FB9; }A.s4:active {text-decoration: underline; color: #808080; }A.s5:link { text-decoration: none; color: #ffffff; }A.s5:visited {text-decoration: none; color: #ffffff; }A.s5:hover {text-decoration: underline; color: #ffffff; }A.s5:active {text-decoration: none; color: #ffffff; }A.s6:link { text-decoration: underline; color: #ffffff; }A.s6:visited {text-decoration: underline; color: #ffffff; }A.s6:hover {text-decoration: underline; color: #ffffff; }A.s6:active {text-decoration: underline; color: #ffffff; }A.s7:link { text-decoration: underline; color: #000000; }A.s7:visited {text-decoration: underline; color: #000000; }A.s7:hover {text-decoration: underline; color: #000000; }A.s7:active {text-decoration: underline; color: #000000; }A.C:link { text-decoration: none; color: #FF7A2E; }A.C:visited {text-decoration: none; color: #FF7A2E; }A.C:hover {text-decoration: none; color: #FF7A2E; background-color: #846749; BORDER-RIGHT: 0px solid; BORDER-TOP: #ffffff 0px solid; BORDER-LEFT: #ffffff 0px solid; BORDER-BOTTOM: #ffffff 0px solid;}A.C:active {text-decoration: none; color: #ffffff; background-color: #FF7A2E; BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid;}A.d:link { text-decoration: none; color: #ffffff; }A.d:visited {text-decoration: none; color: #ffffff; }A.d:hover {text-decoration: none; color: #ffffff; background-color: #846749; BORDER-RIGHT: 0px solid; BORDER-TOP: #ffffff 0px solid; BORDER-LEFT: #ffffff 0px solid; BORDER-BOTTOM: #ffffff 0px solid;}A.d:active {text-decoration: none; color: #FF7A2E; background-color: #ffffff; BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid;}"
	body = body & "-->"
	body = body & "</style>"
	body = body & "<body topmargin=""0"" leftmargin=""0"" rightmargin=""0"" bottommargin=""0"" class=""pagebg"" >"
	body = body & "<div align=""center""><div align=""center""><table border=""0"" width=""500"" cellspacing=""0"" cellpadding=""0"" id=""table1"" height=""100%""><tr><td valign=""top"" bgcolor=""#56391B""><table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" id=""table3""><tr><td height=""56"" rowspan=""2""><img border=""0"" src=""http://www.akyweb.com.sg/ogenic/images/logoOgenic.gif"" width=""300"" height=""111""></td><td width=""4"" bgcolor=""#583B1D""></td></tr><tr><td height=""45"" bgcolor=""#583B1D"" width=""647""><table border=""0"" width=""100%"" cellspacing=""3"" id=""table26"" cellpadding=""2""><tr><td align=""right"" valign=""bottom"" class=""arail15bold""><font color=""#FFFFFF"">Enquiry from "& Name &"</font></td></tr></table></td></tr><tr><td height=""55"" colspan=""3""><table border=""0"" width=""104%"" cellpadding=""2"" bgcolor=""#66FFFF"" id=""table27"" height=""180""><tr><td bgcolor=""#66FFFF"" valign=""top""><div align=""center""><table cellspacing=""3"" cellpadding=""3"" border=""0"" id=""table30"" class=""verdana11"" width=""346""><tr><td width=""150""><b><font color=""#000000"">Name : </font></b></td><td><font color=""#000000"">"&Name&"</font></td></tr><tr><td width=""150""><b><font color=""#000000"">Address : </font></b></td><td><font color=""#000000"">"&Address&"</font></td></tr><tr><td width=""150""><b><font color=""#000000"">Telephone no : </font></b></td><td><font color=""#000000"">"&Telephonenumber&"</font></td></tr><tr><td width=""150""><b><font color=""#000000"">Email Address : </font></b></td><td><font color=""#000000"">"&EmailAddress&"</font></td></tr><tr><td width=""150""><b><font color=""#000000"">Comments : </font></b></td><td><font color=""#000000"">"&Comment&"</font></td></tr></table></div> </td></tr></table><table border=""0"" width=""100%"" id=""table28"" class=""arial11"" height=""40""><tr><td width=""500""><p align=""center""><font color=""#FFFFFF"">COPYRIGHT OGENIC GROUP 2008. ALL RIGHTS RESERVED.POWERED BY <a href=""www.akyweb.com"">AKYWEB.COM</a></font></p></td><td>  </td></tr></table></td></tr></table></td></tr></table></div></div></body>"
	
	'mySmartMail.SenderName = Name
	'mySmartMail.SenderAddress = EmailAddress
	'mySmartMail.Recipients.Add "sales@ogenicgroup.com"
	'mySmartMail.CCs.Add "boon@akyweb.com"
	'mySmartMail.Subject = "Enquiry from OGENICGroup Website"
	'mySmartMail.Body = body
	'mySmartMail.SendMail
	'set mySmartMail= nothing

	myObjMail.from = ""
	myObjMail.to = ToEmail
	myObjMail.subject ="Your OGENIC Registration Info"
	myObjMail.body = body
	myObjMail.send
	set myObjMail = nothing 


end sub
%>




William Lee -> RE: Help... (10/9/2007 0:05:10)

Your website contains only this ONE process.asp?




sssngt83 -> RE: Help... (10/9/2007 0:07:32)

Yes.




William Lee -> RE: Help... (10/9/2007 0:11:17)

ok, it is not so simple, it cannot work with only ONE .asp file.

Can you post your URL so that it helps us to understand better what you are attempting to do.




sssngt83 -> RE: Help... (10/9/2007 1:19:40)

Don't have URL. [:(]
Nevermind, i try again.
Thx your attantion.




William Lee -> RE: Help... (10/9/2007 1:48:56)


quote:

ORIGINAL: sssngt83

Don't have URL. [:(]
Nevermind, i try again.
Thx your attantion.


What do you want to try?




sssngt83 -> RE: Help... (10/9/2007 1:54:08)

Try to see other example and try it....




William Lee -> RE: Help... (10/9/2007 1:58:37)

This example of yours will work, except you have not declare the ADODB objects properly.

Do you know what is the ConnectionString to your database? If you don't know, you won't go far with another example.

You got to find out these info from your supervisor or superior.




sssngt83 -> RE: Help... (10/9/2007 2:00:43)

Ok. Thx a lot...




William Lee -> RE: Help... (10/9/2007 2:01:44)

I'll be waiting for you. [:D]




William Lee -> RE: Help... (10/9/2007 7:34:43)

waiting...waiting...[sm=whistling.gif]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125