Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 6th, 2004, 04:20 AM
Pluto Pluto is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 244 Pluto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 8 h 25 m 59 sec
Reputation Power: 5
Angry error when I go to update data in a database via a form - Type mismatch Cint

Hi there,

Please could someone help me out with this problem I am experiencing :

I seem to getting this error when I go to update data in a database via a form : Type mismatch Cint and it occurs spcecifically on the following piece of code (the line it specifically referrs to is the first line...)

sql10 = "UPDATE Anuncios SET CodPais=" & co & ",CodProvincia=" & pr & ",CodCP=" & fcp & ",Poblacion='" & fpob & _
"',Opcion='" & op & "',Tipo=" & ti & ",Precio='" & fpre & "',Moneda='" & fmon & "',Habitaciones=" & fhab & ",Superficie=" & fsup & _
",Banyos=" & fban & ",Aseos=" & fase & ",Antiguedad=" & fan & ",SuperficieHab='" & fshab & "',Garaje=" & fgar & ",Ascensor=" & fasc & _
",Trastero=" & ftra & ",Calefacción=" & fcal & ",Aire=" & fair & ",Amueblado=" & famu & ",Terraza=" & fter & ", Cocina=" & fcoc & ",Piscina=" & fpis & ",Chimenea=" & fchi & _
",CodIdiomaA='" & fida & "',DescripcionA='" & fdea & "',CodIdiomaB='" & fidb & "',DescripcionB='" & fdeb & "',RutaImagen1='" & fimg1 & _
"',RutaImagen2='" & fimg2 & "',RutaImagen3='" & fimg3 & "' WHERE ID=" & CInt(idanun)


To explain a little this code is on a form page where a client may update the information in a database via this form. If I simply update textboxes radio check boxes, this updates fine. It is when i go to update an uploaded image, which all works fine, I can go to the upload page, and it all uploads fine, and displays in the page fine, it is just when i hit accept to update the information in the database, it then hits the error. Like I say ONLY when an image has been updated.

These are the variables relating to the image location info :
RutaImagen1='" & fimg1 & _ "',RutaImagen2='" & fimg2 & "',RutaImagen3='" & fimg3 &

I would be ever so grateful for ANY help you can offer me on this... its driving me maddd!!

Thanks )

Reply With Quote
  #2  
Old October 6th, 2004, 07:55 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 3 m 32 sec
Reputation Power: 469
If ID is a number, then just do this.
Code:
WHERE ID=" & idanun

Reply With Quote
  #3  
Old October 6th, 2004, 03:15 PM
Pluto Pluto is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 244 Pluto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 8 h 25 m 59 sec
Reputation Power: 5
Still needing help....

Hello,
awww no i am afraid that didnt work, altho it has changed the error message, it now says :

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '='.
/dev/immo-actualizanun.asp, line 897

Applied to the same code as before (below) - Line 897 now referring to the last line : conex10.Execute(sql10)
sql10 = "UPDATE Anuncios SET CodPais=" & co & ",CodProvincia=" & pr & ",CodCP=" & fcp & ",Poblacion='" & fpob & _
"',Opcion='" & op & "',Tipo=" & ti & ",Precio='" & fpre & "',Moneda='" & fmon & "',Habitaciones=" & fhab & ",Superficie=" & fsup & _
",Banyos=" & fban & ",Aseos=" & fase & ",Antiguedad=" & fan & ",SuperficieHab='" & fshab & "',Garaje=" & fgar & ",Ascensor=" & fasc & _
",Trastero=" & ftra & ",Calefacción=" & fcal & ",Aire=" & fair & ",Amueblado=" & famu & ",Terraza=" & fter & ", Cocina=" & fcoc & ",Piscina=" & fpis & ",Chimenea=" & fchi & _
",CodIdiomaA='" & fida & "',DescripcionA='" & fdea & "',CodIdiomaB='" & fidb & "',DescripcionB='" & fdeb & "',RutaImagen1='" & fimg1 & _
"',RutaImagen2='" & fimg2 & "',RutaImagen3='" & fimg3 & "' WHERE ID=" & idanun

conex10.Execute(sql10)

Like I say this ONLY happens when you click to upload a picture, you then go the upload page, it uploads it all totally fine, it rememebers all the field data on the form, so it is not as though it is losing any values??
very very strange!!! Do you have any ideas as to what it might be??? (you would be helping a very desperate person who is tearing their hair out with this haha
Thanks again

Reply With Quote
  #4  
Old October 6th, 2004, 04:58 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 3 m 32 sec
Reputation Power: 469
Do a response.write of you sql statement to make sure it is correct.

Reply With Quote
  #5  
Old October 8th, 2004, 06:49 AM
Pluto Pluto is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 244 Pluto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 8 h 25 m 59 sec
Reputation Power: 5
Hi there, duh sorry yeh did that and have managed to solve it!! Somehow i had a duplicated ID variable throughout the image upload pages, so by the time it was back on the main form, the ID variable was something like this ID = 12, 12 So of course the comma being there was why it was messing up on the int!!! Anyway sorted now - PHEW!! Thank you and sorry for being dumb!

I wonder whether you could help me out with something else, and sorry if I am becoming a total nuicance!!! Could you just give me a brief explination of what each line of this code does, I understand the end result of what it does, but I need to tweak it for another options form and I am just getting to grips with javascript coding as i have kinda stuck to asp and relied on existing javascripts luckily!

Anyway help would be so much appreciated )

Thank you


function ValidarCamposs()
{
var i,valor;

for (i=0;i<document.comprar.pack.length;i++)
{
if (document.comprar.pack[i].checked)
{
valor=document.comprar.pack[i].value;
}
}



document.comprar.action="immo-reganun.asp?idPack=" + valor + "&id=<%=idioma%>";
document.comprar.submit();
}

Reply With Quote
  #6  
Old October 8th, 2004, 01:55 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 3 m 32 sec
Reputation Power: 469
It loops through the checkboxes, determines which one is checked, it gets its value and adds it to the link to submit the form.
Code:
function ValidarCamposs()
{
   var i,valor;

   Loop through the checkboxes
   for (i=0;i<document.comprar.pack.length;i++)
   { 
     If the checkbox is checked
      if (document.comprar.pack[i].checked)
      {
         store the value of the checked checkbox in the valor variable
         valor=document.comprar.pack[i].value;
      }
   }

   Set the action of the form and add the valor variables value to the link the form submits to
   document.comprar.action="immo-reganun.asp?idPack=" + valor + "&id=<%=idioma%>";

   Submit the form
   document.comprar.submit();
}

Reply With Quote
  #7  
Old October 8th, 2004, 02:01 PM
Pluto Pluto is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 244 Pluto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 8 h 25 m 59 sec
Reputation Power: 5
Thank you - your a Star!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > error when I go to update data in a database via a form - Type mismatch Cint


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT