?
Solved

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

Posted on 2009-04-06
5
Medium Priority
?
483 Views
Last Modified: 2012-05-06
Do you use 'true' and 'false' or 'checked' and 'unchecked' or 1 and 0??
0
Comment
Question by:ddepuemd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:ddepuemd
ID: 24076489
this dors not work;

Dim sql As String = "insert into actions ('main','PART INSPECTION',true,false)"
0
 
LVL 46

Expert Comment

by:tbsgadi
ID: 24076491
you can use True and False  but better to use 0 and 1 (-1)

Gary
0
 

Author Comment

by:ddepuemd
ID: 24076558
Both methods gives me a syntax error. do I put single quotes around?
0
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 1000 total points
ID: 24076601
Have you specified the fields?

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

Wayne
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 24076621
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question