Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

insert into yes/no field of ms access in vb.net

Do you use 'true' and 'false' or 'checked' and 'unchecked' or 1 and 0??
0
ddepuemd
Asked:
ddepuemd
1 Solution
 
ddepuemdAuthor Commented:
this dors not work;

Dim sql As String = "insert into actions ('main','PART INSPECTION',true,false)"
0
 
tbsgadiCommented:
you can use True and False  but better to use 0 and 1 (-1)

Gary
0
 
ddepuemdAuthor Commented:
Both methods gives me a syntax error. do I put single quotes around?
0
 
Wayne Taylor (webtubbs)Commented:
Have you specified the fields?

    Dim sql As String = "insert into actions ([Field1], [Field2], [Field3], [Field4]) VALUES ('main','PART INSPECTION',true,false)"

Wayne
0
 
jpaulinoCommented:
Do you have two fields ? you're trying to insert two fields!
You also should change the connection string indicating the fields and the values to insert. If you have an autonumber field you don't use it in the connection string because it's automatically filled
Dim sql As String = "insert into actions(field1, field2, field3) VALUES (value1,value2,value3)"
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now