Solved

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

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Visual Studio installation 5 39
Round up to 100% in .NET 10 46
Get String split 5 33
Format column on datatable 7 18
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now