Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Error Adding New Member
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Error Adding New Member

 Post Reply Post Reply Page  12>
Author
padoxky View Drop Down
Groupie
Groupie
Avatar

Joined: 17 June 2004
Location: Nigeria
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote padoxky Quote  Post ReplyReply Direct Link To This Post Topic: Error Adding New Member
    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
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
padoxky View Drop Down
Groupie
Groupie
Avatar

Joined: 17 June 2004
Location: Nigeria
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote padoxky Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
padoxky View Drop Down
Groupie
Groupie
Avatar

Joined: 17 June 2004
Location: Nigeria
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote padoxky Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.