Click here to Skip to main content
15,886,518 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to make windows can't for shutdown/reboot/loggoff? Pin
Yance Lawang2-Jan-11 18:35
Yance Lawang2-Jan-11 18:35 
QuestionDisappearing Console Caption Icon? [Solved] Pin
Saul Johnson27-Dec-10 14:42
Saul Johnson27-Dec-10 14:42 
AnswerRe: Disappearing Console Caption Icon? Pin
Luc Pattyn27-Dec-10 14:56
sitebuilderLuc Pattyn27-Dec-10 14:56 
GeneralRe: Disappearing Console Caption Icon? Pin
Saul Johnson27-Dec-10 15:14
Saul Johnson27-Dec-10 15:14 
GeneralRe: Disappearing Console Caption Icon? Pin
Luc Pattyn27-Dec-10 15:19
sitebuilderLuc Pattyn27-Dec-10 15:19 
GeneralRe: Disappearing Console Caption Icon? Pin
Saul Johnson27-Dec-10 15:27
Saul Johnson27-Dec-10 15:27 
GeneralRe: Disappearing Console Caption Icon? Pin
Luc Pattyn27-Dec-10 15:37
sitebuilderLuc Pattyn27-Dec-10 15:37 
QuestionNeeding help with Oledb programming Pin
John Mobley26-Dec-10 15:18
John Mobley26-Dec-10 15:18 
I am working on a program that accesses two different databases. One of them has only one table and I am not having any problems with access/working it. The second database has three tables in it that I need access to and this is where the problems arise.

I have no problem reading the tables. I can navigate the records and even delete them without issues. However when I try to update a record, or add a record to the database I get the following error messages:

When trying to edit/update a record:
System.Data.OleDb.OleDbException was unhandled
ErrorCode=-2147217900
Message=Syntax error in UPDATE statement.

When trying to add a record:
System.Data.OleDb.OleDbException was unhandled
ErrorCode=-2147217900
Message=Syntax error in INSERT INTO statement.

I have looked over the code time and time again and I can't find anything wrong with it. It is identical to the code that I currently have working with the single table database. Below is one of the code blocks that I am having issues with:

Private Sub btnCommitSignin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCommitSignin.Click

        Dim SignCB As New OleDb.OleDbCommandBuilder(SignDataAdapter)
        Dim SignNewRecord As DataRow

        SignNewRecord = SignDataSet.Tables("SignIn").NewRow()

        SignNewRecord.Item(2) = cmbpatronsignin.Text
        SignNewRecord.Item(1) = txtDateSignin.Text
        SignNewRecord.Item(3) = txtTimeIn.Text
        SignNewRecord.Item(4) = txtTimeOut.Text

        SignDataSet.Tables("SignIn").Rows.Add(SignNewRecord)
        SignDataAdapter.Update(SignDataSet, "SignIn")

        MsgBox("New sign-in registered.")

        SignMaxRows = SignMaxRows + 1
        SignInc = 0

        NavigateSignInRecords()

        cmbpatronsignin.Visible = False
        txtDateSignin.Visible = False
        txtTimeIn.Visible = False
        txtTimeOut.Visible = False

        btnAddSignIn.Visible = True
        btnEditSignin.Visible = True
        btnDeleteSignin.Visible = True
        btnCommitSignin.Visible = False
        btnApproveSignin.Visible = False
        btnCancelSignIn.Visible = False

    End Sub


The program always crashes at the line:

SignDataAdapter.Update(SignDataSet, "SignIn")

If I comment it out and rerun the program, the dataset updates without any problems so I know that it has to do with the update command.

What could be some of the issues that I am having? What are the solutions to them?
AnswerRe: Needing help with Oledb programming Pin
Dave Kreskowiak26-Dec-10 18:56
mveDave Kreskowiak26-Dec-10 18:56 
AnswerRe: Needing help with Oledb programming Pin
_Erik_27-Dec-10 2:55
_Erik_27-Dec-10 2:55 
Questionresource Pin
hamidehhhhhhh25-Dec-10 23:04
hamidehhhhhhh25-Dec-10 23:04 
AnswerRe: resource Pin
Richard MacCutchan25-Dec-10 23:11
mveRichard MacCutchan25-Dec-10 23:11 
AnswerRe: resource Pin
Abhinav S25-Dec-10 23:19
Abhinav S25-Dec-10 23:19 
AnswerRe: resource Pin
Dave Kreskowiak26-Dec-10 5:13
mveDave Kreskowiak26-Dec-10 5:13 
AnswerRe: resource Pin
Luc Pattyn26-Dec-10 5:42
sitebuilderLuc Pattyn26-Dec-10 5:42 
GeneralRe: resource Pin
Henry Minute27-Dec-10 0:21
Henry Minute27-Dec-10 0:21 
GeneralRe: resource Pin
Luc Pattyn27-Dec-10 4:55
sitebuilderLuc Pattyn27-Dec-10 4:55 
GeneralRe: resource Pin
Dalek Dave27-Dec-10 12:42
professionalDalek Dave27-Dec-10 12:42 
GeneralRe: resource Pin
Luc Pattyn27-Dec-10 12:49
sitebuilderLuc Pattyn27-Dec-10 12:49 
GeneralRe: resource Pin
Alan Burkhart28-Dec-10 18:44
Alan Burkhart28-Dec-10 18:44 
QuestionRe: resource Pin
Luc Pattyn28-Dec-10 23:39
sitebuilderLuc Pattyn28-Dec-10 23:39 
AnswerRe: resource Pin
Alan Burkhart29-Dec-10 3:40
Alan Burkhart29-Dec-10 3:40 
QuestionWhere is my mistake in SQL Pin
ivo7525-Dec-10 7:35
ivo7525-Dec-10 7:35 
AnswerRe: Where is my mistake in SQL Pin
Dr.Walt Fair, PE25-Dec-10 8:03
professionalDr.Walt Fair, PE25-Dec-10 8:03 
GeneralRe: Where is my mistake in SQL Pin
ivo7525-Dec-10 8:22
ivo7525-Dec-10 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.