Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2010, 01:33 AM
Registered User
 
Join Date: Jun 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Name redefined at dbc

Hung Up at .dbc. in the dim line
ASP 2.0 site

Microsoft VBScript compilation error '800a0411'

Name redefined

/newslettersubscribe_cn-name.asp, line 7

dim Lname,Sname,email,dbc,cm_name,cm_iytht_iytht,flag, custid,custemail,mySQL,rstemp
----------------------^

Code:
<%option explicit%>
<!-- #include file="shop$db.asp" -->

<html>
<body>
<%
dim Lname,Sname,email,dbc,cm_name,cm_iytht_iytht,flag,custid,custemail,mySQL,rstemp
flag=request("flag")
'Response.Write(submit)
'Response.End()
if flag="y" then
cm_name=request("cm-name")
cm_iytht_iytht=request("cm-iytht-iytht")
Sname=Split(cm_name)
if Ubound(Sname)>0 then
Lname=Sname(Ubound(Sname))
else
Lname=cm_name 
end if	

shopopendatabase dbc		
mySQL="SELECT * FROM customers WHERE email='" &cm_iytht_iytht& "' "
set rstemp=dbc.execute(mySQL)
if rstemp.eof  then

sql="insert into customers (lastname,email,custother1) values ('" & Lname & "','" & cm_iytht_iytht & "', 'newsletter')"
dbc.execute(sql)

else
custid = rstemp("contactid")
custemail=rstemp("email")
' update if email present in data base
mySQL="update customers set lastname='" & Lname & "',email='" & cm_iytht_iytht & "',custother1='newsletter' where contactid=" & custid & " and email='" & custemail & "'"
Response.Write(mySQL)
dbc.execute(mySQL)
end if

	
%>
<form name="news_subs" action="http://createsend.showtheworld.com.au/t/r/s/iytht/" method="post" >
<input type="hidden" name="cm-name" id="cm-name" value="<%=cm_name %>" />
<input type="hidden" name="cm-iytht-iytht" id="cm-iytht-iytht" value="<%=cm_iytht_iytht %>" />
<input type="hidden" name="flag" value="n">
</form>
<script>
document.news_subs.submit();
</script>
<% else 
'Response.Redirect"default.asp"
Response.Redirect"http://www.tomswaterhole.com.au/"
end if
%>
</body>
</html>
 
Old June 14th, 2010, 04:01 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Looks like your include file shop$db.asp (or any file that file is including) has already defined the dbc variable you're defining here.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.