Results 1 to 3 of 3

Thread: [RESOLVED] insert into statement is inserting -1

  1. #1

    Thread Starter
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Resolved [RESOLVED] insert into statement is inserting -1

    with access 2003

    please advise me what is wrong in this code,
    Code:
    INSERT INTO ZXT6output VALUES(a = @a,b = @b,c=@c,d = @d,e = @e,f = @f,g = @g,h = @h,i = @i)
    if i execute this query from with in the access or from externally (through vb.net05) query is working fine but irrespective of the parameters passed in it being inserted with -1 only to the table

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: insert into statement is inserting -1

    You are using the wrong syntax, so are just inserting Boolean values.

    The syntax should ideally be:
    Code:
    INSERT INTO tablename (field1, field2) VALUES (value1, value2)
    ...but most databases unfortunately accept this too (which is prone to bugs etc), which is almost what you had:
    Code:
    INSERT INTO tablename VALUES (value1, value2)

  3. #3

    Thread Starter
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Wink Re: insert into statement is inserting -1

    thanks sir

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width