Error When Saving New Records to VFP Table


Author
Message
Brooks Adair
Brooks Adair
StrataFrame Beginner (8 reputation)StrataFrame Beginner (8 reputation)StrataFrame Beginner (8 reputation)StrataFrame Beginner (8 reputation)StrataFrame Beginner (8 reputation)StrataFrame Beginner (8 reputation)StrataFrame Beginner (8 reputation)StrataFrame Beginner (8 reputation)StrataFrame Beginner (8 reputation)
Group: Forum Members
Posts: 8, Visits: 32
I have created a Business Object mapping to a VFP table. I have created a maintenance form and mapped a few fields to it. Navigation works fine, editing and saving an existing record works fine, but when I save a new record I get an exception: "Command contains unrecognized phrase/keyword." After the error message I am left in edit mode. However, If I check the table, the record has been saved.



I searched the forum and found out about the debug log. So I set it up. It appears that the command causing the error is "SELECT @@IDENTITY". It looks like the initial INSERT command goes fine, and I guess the second command is an attempt to retrieve the newly generated primary key value. Am I doing something wrong here? Where do I need to look or what do I need to change?



Below is the stack trace:



BusinessLayerException

An error occurred while saving an the data to the server.

DataLayerSavingException

Command contains unrecognized phrase/keyword.

OleDbException

Command contains unrecognized phrase/keyword.



Source : MicroFour StrataFrame Business



Stack Trace:

at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)

at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)

at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)

at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)

at System.Data.OleDb.OleDbCommand.ExecuteScalar()

at MicroFour.StrataFrame.Data.DbDataSourceItem.InternalExecuteScalar(DbCommand Command, Boolean IsTransactional, String TransactionKey)

at MicroFour.StrataFrame.Data.VfpDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)

at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)

at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)

at MicroFour.StrataFrame.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()

at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdSave_Click(Object sender, EventArgs e)

at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)

at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)

at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)

at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)

at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)

at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)

at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ToolStrip.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Brooks Adair - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Brooks Adair - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Brooks Adair - 17 Years Ago
                         What version of VFP database are you using? I believe all of the VFP...
StrataFrame Team - 17 Years Ago
                             Yes. The tables are from VFP 9.0 with SP1.
Brooks Adair - 17 Years Ago
                                 I'll have to take a look at this. No promise on the timeframe; I'll...
StrataFrame Team - 17 Years Ago
                                     Ok, thats fine. Since I am writing a small app from scratch, and have...
Brooks Adair - 17 Years Ago
                                         [quote]Does it use full Rushmore optimization? How does the speed...
Trent L. Taylor - 17 Years Ago
                                             Thanks for the info.

I just purchased a full version of...
Brooks Adair - 17 Years Ago
                                                 We have a prescription medication database that contains several...
StrataFrame Team - 17 Years Ago
                                                     As long as you remember that you're not directly connected to the...
StrataFrame Team - 17 Years Ago
                                                         Thanks for the info, sounds like the VFPOLEDB provider will be good...
Brooks Adair - 17 Years Ago
                             Hi I am getting the same error on VFP 9.0 SP1 data. For autoInc...
Calvin Y Tang - 16 Years Ago
                                 OK....sorry for the delay here, but we went ahead and added the...
Trent L. Taylor - 16 Years Ago
                                     Thank you, I will try that out. Does this return the last ID for the...
Calvin Y Tang - 16 Years Ago
                                         FoxPro doesn't support @@IDENTITY, so the code has been added to...
Trent L. Taylor - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search