Solved

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

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

Independent Software Vendors: 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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 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