Print Page | Close Window

Error Adding New Member

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=16445
Printed Date: 29 March 2026 at 8:34pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Error Adding New Member
Posted By: padoxky
Subject: Error Adding New Member
Date Posted: 05 September 2005 at 10:43am

Please i want you guys to examine this script, if there's any error in it.
Because am having an error message saying:

"Data Type Mismatch in criteria expression.
/xxx/xxxl/xxx/reg1.asp, line100"

And is pointing at this cmd;  "Set rsNewUser = adoCon.Execute(strSQL)"

 
 
Here is form
<form method="post" action="reg1.asp?pg=new" name="frm">

<div align="center">
<table border="0" width="97%"
          id="table9" height="635"
          cellspacing="0" cellpadding="0">
           <tr>
            <td height="26">&nbsp; <% if session("Error") = 0 then
            response.write"<font color=navy face=arial size=2> Enter Information:</font>"
            else
            session("Error") = "0"
            response.write"<font color=red face=arial size=2> There are some errors in your data. Please, double check your data.</font>"

            end if  %></td>
           </tr>
           <tr>
            <td valign="top"
            style="border: 1px solid #C7D2DC">
            <div align="center">
             <table border="0"
             width="447" id="table10"
             height="538"
             cellspacing="0"
             cellpadding="0">
              <tr>
               <td valign="top"
               height="19"
               width="447"
               colspan="3">&nbsp;</td>
              </tr>
              <tr>
               <td valign="top"
               width="121"
               align="right"><font face="Arial"><span style="font-size: 9pt">
               Account Type:</span></font></td>
               <td valign="top"
               width="9">&nbsp;</td>
               <td valign="top"
               width="317">&nbsp;<SELECT
                &nbs p;       style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" size=1
                &nbs p;       name=txtAccType>
               <option selected
               value="Premium">Premium</option>
               <option >
               Beta
               </optio n>
               <option >
               Standard
               </optio n>
               </SELEC T></td>
              </tr>
              <tr>
               <td valign="top"
               width="121"
               align="right"><font face="Arial"><span style="font-size: 9pt">
               Currency:& lt;/span></font></td>
               <td valign="top"
               width="9">&nbsp;</td>
               <td valign="top"
               width="317">&nbsp;<SELECT
                &nbs p;       style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" size=1
                &nbs p;       name=txtCurrency>
               <option selected
               value="&amp;euro;[EURO]">€ [EURO]</option>
               <option value="£ [POUNDS]">
               £ [POUNDS]
               </optio n>
               <option value="$ [DOLLAR]">
            &nb

-------------
NgWebDesigns




Replies:
Posted By: dpyers
Date Posted: 05 September 2005 at 11:32am
Do a response.write strSQL just prior to the error line. 

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: padoxky
Date Posted: 05 September 2005 at 12:23pm
I don't really get you right.
 
What  do you mean by
response.write strSQL and where is that?
 


-------------
NgWebDesigns


Posted By: dpyers
Date Posted: 05 September 2005 at 12:53pm
The code builds sql statements in strSQL but the final sql string you are trying to execute is not valid. You need to look at it and see what might be wrong in order to correct the code that creates the SQL string.

Putting the statement
response.write strSQL
just before you execute the string at line 100 will print out the sql so you can examine it.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: padoxky
Date Posted: 05 September 2005 at 1:07pm
Well, that's means if i just do as you said it will print out the error.
 
I thought that the error comes from the strSQL code that is mismatching data or whatever.
All is a solution to the problem or if you hv anyother ways to handle this let me know.
 
 
 


-------------
NgWebDesigns


Posted By: dpyers
Date Posted: 05 September 2005 at 2:11pm
It'll print out the sql string that's causing the error.
Then you can look at the string to see if it's malformed and look at the data in the string to see if it lines up with your field definitions in the db.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: ub3rl337ch3ch
Date Posted: 05 September 2005 at 6:56pm

do:

response.write strSQL
response.end
 
so that it stops the rest of the code after writing out the sql string. I've discovered in the past that without doing this, it sometimes prints the sql in the html and then displays the error code, and it sometimes displays nothing but the error code. This way you shouldn't have any troubles. Just comment it out when you want to run the rest of the code...


Posted By: dpyers
Date Posted: 05 September 2005 at 7:57pm
Good point.
In this instance, he should probably reset the server objects before the response.end also so no connections are left hanging.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: ub3rl337ch3ch
Date Posted: 05 September 2005 at 9:53pm

*note to self*

must remember to do that... LOL

 
perhaps a dumb question, but what exactly does leaving the connections hanging actually do? i know its bad, but not why... Embarrassed


Posted By: padoxky
Date Posted: 06 September 2005 at 5:46am
Thanks buddies,
 
I have found the error. Is from my database tbls, the strConfirm = RandomPW(0)  suppose to be a Text field in my database tbl but i mistakely used Number field instead of Text that is the reason the error occured.
 
But, is there any of my connection left hanging?
 
LOL


-------------
NgWebDesigns


Posted By: dpyers
Date Posted: 06 September 2005 at 7:09pm
Connections come from a pool and there's only so many to go around for all the sites hosted on the server. They'll attempt to clean themselves up after some period of inactivity but sometimes they don't release the memory they use.

With 500 other sites on a machine all opening and closing connections you don't have to run a script that leaves connections hanging very many times before iis has to reset. Problem occurs more often if you're developing online.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: ub3rl337ch3ch
Date Posted: 06 September 2005 at 7:16pm
*fixes programs* Embarrassed
 
is it just connections or recordsets (the object, i'm not quite lazy/forgetful enough to forget vrec.close) and the like as well?
 
also, to continue my hijacking of this thread, is there a way to close connections similar to opening them with a server side include? or can ssi's only be used at the start of a file?


Posted By: dpyers
Date Posted: 07 September 2005 at 4:39am
You can put an ssi anywhere. You just have to be careful with the asp open and close tags - <% and %>.
If your ssi code has them you'll have to put close %> before the ssi then open <% after the ssi.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: padoxky
Date Posted: 07 September 2005 at 5:08am
Can you pin point the connections that is left hanging. I think i close all my connection by using this
 
Set rsNew = nothing.
 
Or they any other way of doing that?


-------------
NgWebDesigns


Posted By: dpyers
Date Posted: 07 September 2005 at 5:16am
your connections were ok... it would have only happened if you used response.end before closing the connections.

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: padoxky
Date Posted: 07 September 2005 at 5:23am
can you tell me the differences between
 
Set rsNew = nothing
and
rsNew.Close
 
 


-------------
NgWebDesigns



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net