jimlocigno
Posts: 14
|
Posted: 12/02/2004, 6:20 PM |
|
Okay had to take a temporary break from figuring out code charge - am back now and still very new at this.
Anyway, when I try and add a record via the webpage I created I get
Microsoft JET Database Engine:Syntax error in INSERT INTO statement.
Is there anyway to get a more specific message as to what is wrong the insert statement. Thanks.
Jim
|
|
|
mrachow
Posts: 509
|
Posted: 12/03/2004, 1:15 AM |
|
From the Component Reference
Additionally, you can use the Before Execute Select event of a Grid to examine the Grid's SQL statement
with the following code:
System.Web.HttpContext.Current.Response.Write(Select.ToString());
System.Web.HttpContext.Current.Response.Write(_Select.ToString())
When seeing the statement you maybe will find the problem.
plus
a wild guess
I had an issue when placing entry fields as first controls on a record form that were not tied to a database column. Then a wrong SQL statement was generated (the column list started with a comma).
I had worked around that by setting the Control Source Type of such unrelated controls to Code Expression even so that property shouldn't matter for not database related controls.
_________________
Best regards,
Michael |
|
|
jimlocigno
Posts: 14
|
Posted: 12/03/2004, 3:12 AM |
|
Thanks very much for the reply I have tried to add what you sent but I get this error when trying to publish the project
Error: C:\DOCUME~1\Jim\LOCALS~1\Temp\~vtrack\components\days_offDataProvider.vb(609) : error BC30201: Expression expected.
System.Web.HttpContext.Current.Response.Write(Select.ToString())
~~~~~~
Error: C:\DOCUME~1\Jim\LOCALS~1\Temp\~vtrack\components\days_offDataProvider.vb(610) : error BC30451: Name '_Select' is not declared.
System.Web.HttpContext.Current.Response.Write(_Select.ToString())
~~~~~~~
I'm sure it's something simple that I am missing but don't what!!
Jim
|
|
|
mrachow
Posts: 509
|
Posted: 12/03/2004, 3:42 AM |
|
Sorry I'm not that familar with .NET
If I interpret the manual correct if statements for .NET are given the first one is for C# the second one for VB.
So use the second only.
Maybe the underscore in front of Select is a typo?
Plus are you sure being in the right event (Before Execute Select of the grid)?
_________________
Best regards,
Michael |
|
|
Stan
|
Posted: 12/05/2004, 11:13 PM |
|
Michael
In case of Record form, the correct event will be Before Execute Select of Record form with following code
System.Web.HttpContext.Current.Response.Write(Select_.ToString())
Note that underscore is placed at the end of Select.
Stan
|
|
|