Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Taking an integer value from database...


Message #1 by "Handy" <handymulia@h...> on Thu, 28 Feb 2002 13:56:01
Hi, does anybody know how to solve it ?





Set a = conn.execute("SELECT Stock FROM product where name = 'x' ")

    b = Request.Form("quantity")

          

If b > a Then     <== ERROR HERE

.

.

.



The error message is : "Type Mismatch"

If I change the a to a number, say 5, it works, no error.



In the database, field "Stock" is of Integer type..



Does anybody know how to solve it??





THanks alot !!













Message #2 by Sam Clohesy <sam@e...> on Thu, 28 Feb 2002 13:53:41 -0000
Have you tried:

Cint and trim on a and b?



Sam Clohesy

Project Manager

Tel: 0208 772 3958

E: samc@e...

W: http://www.etypemedia.co.uk





-----Original Message-----

From: Handy [mailto:handymulia@h...]

Sent: 28 February 2002 13:56

To: ASP Databases

Subject: [asp_databases] Taking an integer value from database...





Hi, does anybody know how to solve it ?





Set a = conn.execute("SELECT Stock FROM product where name = 'x' ")

    b = Request.Form("quantity")

          

If b > a Then     <== ERROR HERE

.

.

.



The error message is : "Type Mismatch"

If I change the a to a number, say 5, it works, no error.



In the database, field "Stock" is of Integer type..



Does anybody know how to solve it??





THanks alot !!


















$subst('Email.Unsub').

Message #3 by "Peter Foti (PeterF)" <PeterF@S...> on Thu, 28 Feb 2002 11:03:53 -0500
You are setting "a" to a recordset.  Not a variable.  This should do the

trick:



Set a = conn.execute("SELECT Stock FROM product where name = 'x' ")

    b = Request.Form("quantity")



if b > a("Stock") Then





> -----Original Message-----

> From: Handy [mailto:handymulia@h...]

> Sent: Thursday, February 28, 2002 1:56 PM

> To: ASP Databases

> Subject: [asp_databases] Taking an integer value from database...

> 

> 

> Hi, does anybody know how to solve it ?

> 

> 

> Set a = conn.execute("SELECT Stock FROM product where name = 'x' ")

>     b = Request.Form("quantity")

>           

> If b > a Then     <== ERROR HERE

> .

> .

> .

> 

> The error message is : "Type Mismatch"

> If I change the a to a number, say 5, it works, no error.

> 

> In the database, field "Stock" is of Integer type..

> 

> Does anybody know how to solve it??

> 

> 

> THanks alot !!

> 

> 

> 

> 

> 

> 

> 




> $subst('Email.Unsub').

> 


  Return to Index