sigkappu
asked on
Error message executing a sql statement in an ASP page
I am receiving the following error on my asp page.
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near ','.
/doUpload.asp, line 102
On line 102, it is trying to execute the following sql statement:
INSERT INTO FacilitySource VALUES ('3/4/2007 15:00','RIT-00107','RIT AID CORPORATION','107','','FS' ,3,4396,'' ,4396,'Pre ventive Maintenance','PARKINGLOTSW EEPINGMAIN TPM','PARK ING LOT SWEEPING PM','RIT-00107 - PARKING LOT SWEEPING PM - 1X/WK','REISINGER, JENNIFER','PS','PM-10009', 'INPRG','I n Progress (INPRG)','43',,8490,'GENES IS','GENES IS','0','N O','','NO' ,'43','43' ,'1/18/200 7','NO','' ,'654 COLVIN AVENUE','KENMORE','NY',142 17-2825,'7 16-447-912 8','No','N o','','',' ','');
Any help on fixing this problem is greatly appreciated.
Thanks
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near ','.
/doUpload.asp, line 102
On line 102, it is trying to execute the following sql statement:
INSERT INTO FacilitySource VALUES ('3/4/2007 15:00','RIT-00107','RIT AID CORPORATION','107','','FS'
Any help on fixing this problem is greatly appreciated.
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
'43',,8490, Is just a blank field on creation it gets updated at a later date to contain a value
I changed 14217-2825 to 14217 and I still get the same error.
Any other of ideas of what it might be? I'm at a loss.
I changed 14217-2825 to 14217 and I still get the same error.
Any other of ideas of what it might be? I'm at a loss.
Is the first field of your table defined as character or date/time? Probably the date should be formatted...
try change '43',,8490 to '43','',8490 and change 14217-2825 to '14217-2825' ?
like:
INSERT INTO FacilitySource VALUES ('3/4/2007 15:00','RIT-00107','RIT AID CORPORATION','107','','FS' ,3,4396,'' ,4396,'Pre ventive Maintenance','PARKINGLOTSW EEPINGMAIN TPM','PARK ING LOT SWEEPING PM','RIT-00107 - PARKING LOT SWEEPING PM - 1X/WK','REISINGER, JENNIFER','PS','PM-10009', 'INPRG','I n Progress (INPRG)','43','',8490,'GEN ESIS','GEN ESIS','0', 'NO','','N O','43','4 3','1/18/2 007','NO', '','654 COLVIN AVENUE','KENMORE','NY','14 217-2825', '716-447-9 128','No', 'No','','' ,'','');
like:
INSERT INTO FacilitySource VALUES ('3/4/2007 15:00','RIT-00107','RIT AID CORPORATION','107','','FS'
ASKER
The first field is defined as date/time. What formatting do I need to do to it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
For the field I want to be empty when it inserts, it is a numeric field. What can I put into the SQL statement to put an empty field in? If it were a text field I would put '', but I don't know what to put for a numberic field.
>>What can I put into the SQL statement to put an empty field in? If it were a text field I would put '', but I don't know what to put for a numberic field.
try put a 0 (zero) or if it allows NULL, you can try put NULL on that field.
or else, explicitly describe what fields you want to insert with values in your Insert SQL statement, like:
Insert into yourTable (field1, field2, fieldN ) values ('value1' , 12345, '3/25/2007');
try put a 0 (zero) or if it allows NULL, you can try put NULL on that field.
or else, explicitly describe what fields you want to insert with values in your Insert SQL statement, like:
Insert into yourTable (field1, field2, fieldN ) values ('value1' , 12345, '3/25/2007');
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
provide a 0 for numeric fields that you want empty.
band.
band.
some value is missing here, try check your scripting to rectify this...