Link to home
Start Free TrialLog in
Avatar of ddepuemd
ddepuemd

asked on

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??
Avatar of ddepuemd
ddepuemd

ASKER

this dors not work;

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

Gary
Both methods gives me a syntax error. do I put single quotes around?
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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)"