Click here to Skip to main content
15,909,051 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSystem.ExecutionEngineException Pin
dimuthuvbnet22-Aug-07 15:40
dimuthuvbnet22-Aug-07 15:40 
AnswerRe: System.ExecutionEngineException Pin
Michael Sync22-Aug-07 20:29
Michael Sync22-Aug-07 20:29 
AnswerRe: System.ExecutionEngineException Pin
Vimalsoft(Pty) Ltd22-Aug-07 21:12
professionalVimalsoft(Pty) Ltd22-Aug-07 21:12 
QuestionHow to Fast search data in XML ? Pin
nimolZero22-Aug-07 15:40
nimolZero22-Aug-07 15:40 
AnswerRe: How to Fast search data in XML ? Pin
Christian Graus22-Aug-07 15:49
protectorChristian Graus22-Aug-07 15:49 
QuestionErr when add record into database Pin
Mekong River22-Aug-07 15:13
Mekong River22-Aug-07 15:13 
AnswerRe: Err when add record into database Pin
Christian Graus22-Aug-07 16:41
protectorChristian Graus22-Aug-07 16:41 
GeneralRe: Err when add record into database Pin
Mekong River22-Aug-07 16:47
Mekong River22-Aug-07 16:47 
Christian Graus wrote:
Try just listing the columns without the table name. Also, your strings don't have quotes around them, this will cause an error.


I try to remove as your suggestion. The below is the statement that I just remove:

Dim cmdAddProgBudInfo As New OleDbCommand
                        With cmdAddProgBudInfo
                            .Connection = cnnDonorDb
                            .CommandType = CommandType.Text
                            .CommandText = "INSERT INTO tblProgBudget (ProgID, Year, GovContrib, OrgContrib) VALUES (" & Val(strProgID) & ", " & Val(txtYearBudPlan.Text) & ", " & Val(txtGovCont.Text) & ", " & Val(txtOwnCont.Text) & ")"
                        End With


But it still display an error with the below exception:

System.Data.OleDb.OleDbException was unhandled<br />
  ErrorCode=-2147217900<br />
  Message="Syntax error in INSERT INTO statement."<br />
  Source="Microsoft JET Database Engine"<br />
  StackTrace:<br />
       at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)<br />
       at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)<br />
       at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)<br />
       at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)<br />
       at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()<br />
       at DIC_Donor_Database.frmProgBudget.btnAddProg_Click(Object sender, EventArgs e) in C:\Documents and Settings\roathkanel\My Documents\Visual Studio 2005\Projects\DIC Donor Database\DIC Donor Database\frmProgBudget.vb:line 182<br />
       at System.Windows.Forms.Control.OnClick(EventArgs e)<br />
       at System.Windows.Forms.Button.OnClick(EventArgs e)<br />
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br />
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)<br />
       at System.Windows.Forms.Control.WndProc(Message& m)<br />
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)<br />
       at System.Windows.Forms.Button.WndProc(Message& m)<br />
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br />
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br />
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<br />
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br />
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br />
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br />
       at System.Windows.Forms.Application.Run(ApplicationContext context)<br />
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()<br />
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()<br />
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)<br />
       at DIC_Donor_Database.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81<br />
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)<br />
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<br />
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br />
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
       at System.Threading.ThreadHelper.ThreadStart()


I think the cause of the problem is the value of the autonumber field. I don't know how to set it.
QuestionRe: Err when add record into database Pin
Vimalsoft(Pty) Ltd22-Aug-07 23:28
professionalVimalsoft(Pty) Ltd22-Aug-07 23:28 
AnswerRe: Err when add record into database Pin
Mekong River22-Aug-07 23:57
Mekong River22-Aug-07 23:57 
GeneralRe: Err when add record into database Pin
Vimalsoft(Pty) Ltd23-Aug-07 0:15
professionalVimalsoft(Pty) Ltd23-Aug-07 0:15 
GeneralRe: Err when add record into database Pin
Dave Kreskowiak23-Aug-07 3:14
mveDave Kreskowiak23-Aug-07 3:14 
QuestionDelegates [modified] Pin
ASPnoob22-Aug-07 13:02
ASPnoob22-Aug-07 13:02 
AnswerRe: Delegates Pin
Christian Graus22-Aug-07 15:52
protectorChristian Graus22-Aug-07 15:52 
QuestionHighlighting text in a webbrowser control Pin
Ahmad Zaidi22-Aug-07 11:09
Ahmad Zaidi22-Aug-07 11:09 
AnswerRe: Highlighting text in a webbrowser control Pin
nlarson1122-Aug-07 11:28
nlarson1122-Aug-07 11:28 
QuestionMost Efficient Data Control Pin
errorfunktion22-Aug-07 8:59
errorfunktion22-Aug-07 8:59 
AnswerRe: Most Efficient Data Control Pin
Luc Pattyn22-Aug-07 14:10
sitebuilderLuc Pattyn22-Aug-07 14:10 
GeneralRe: Most Efficient Data Control Pin
errorfunktion22-Aug-07 18:13
errorfunktion22-Aug-07 18:13 
GeneralRe: Most Efficient Data Control Pin
Dave Kreskowiak23-Aug-07 3:10
mveDave Kreskowiak23-Aug-07 3:10 
QuestionDataGrid Record Loop. Pin
Smokeywade22-Aug-07 8:27
Smokeywade22-Aug-07 8:27 
AnswerRe: DataGrid Record Loop. Pin
jchigg200022-Aug-07 9:00
jchigg200022-Aug-07 9:00 
GeneralRe: DataGrid Record Loop. Pin
Smokeywade22-Aug-07 9:49
Smokeywade22-Aug-07 9:49 
GeneralRe: DataGrid Record Loop. Pin
jchigg200022-Aug-07 10:14
jchigg200022-Aug-07 10:14 
GeneralRe: DataGrid Record Loop. Pin
Smokeywade22-Aug-07 10:38
Smokeywade22-Aug-07 10:38 

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.