Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-04-06
5
Medium Priority
?
491 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 48

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

Industry Leaders: 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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

597 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