DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Sql Server 2000 variables

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Sql Server 2000 variables

    [Originally posted by Francis]

    i have 2 questions. first
    when you make a field whit Int(4)
    how many caracter you are supossed to be able to put in. Because my database accept 6. thats wierd.

    second question. I'm trying to add data to a table whit vb. But 1 field cause me problem. Its a money field. I use adodb and i execute from my connection a insert. If i copy my request in query analiser everything work fine but
    from vb it's says the field whit money cannot be add. that's how i type it.
    cnConnection.execute("INSERT INTO tbl_table (VIN,Name,Bookvalue) VALUES('" & txtVIN.text & "','" & txtName.text & "','" & txtBookvalue.text & "')")
    after i try whitout '' for the bookvalue field
    and still not working. If i dont use the field all is working so the problem is the format. It try formatcurrency but its not working too.

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Sql Server 2000 variables

    [Originally posted by m.posseth@work]

    well you think in the wrong way :-)

    a integer data type 4 ( "normall" integer data type )
    can hold nummeric values
    from -2,147,483,64 to 2,147,483,647 and will only costs you 4 bytes of storage space

    about the second issue

    if you add a non alpha nummeric value to a database you can forget the '' marks

    this should work ( asuming that txtBookvalue.text is the currency value)


    cnConnection.execute("INSERT INTO tbl_table (VIN,Name,Bookvalue) VALUES('" & txtVIN.text & "','" & txtName.text & "'," & txtBookvalue.text & ")")



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center