Solved

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

Posted on 2009-04-06
5
471 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 250 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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