M
marcus.skillern
I am letting the end-user select the file to be imported into the SQL via
the intranet. I am getting this error displayed.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Bulk Insert: Unexpected
end-of-file (EOF) encountered in data file.
/loaddata/file.asp, line 15
Here is a copy of the asp file
<html><head><title>Loading file</title></head><body>
<%
x = request.form("filename")
response.write "the file is = "&x
set myCon = Server.CreateObject("ADODB.Connection")
mycon.Open "NIPDB"
set myCmd = server.CreateObject("Adodb.command")
mycmd.activeconnection = mycon
mycmd.commandText = "LDS"
mycmd.commandType = 4
Set BudRS5 = mycmd.execute(,array(x))
budrs5.close
mycon.close
set mycon = nothing
%></body></html>
Here is copy of stored procedure LDS
CREATE procedure LDS(@Filein nvarchar(50)) AS
DECLARE @SQLString NVARCHAR(80)
/* Build Command*/
SET @SQLString =
N'Bulk Insert DailyTbl from ' + N'N''' + @Filein + N'''FIRSTROW = 2,
MAXERRORS = 0,
FIELDTERMINATOR = ",",
ROWTERMINATOR = "\n,\t"'
/* Execute */
EXEC (@SQLString)
GO
Here is a sample of data held within the .csv file
Day,Date,Line,Line Description,Registered Sales (£),Sales SUs,Reduced
(£),Explained Wastage,Reductions % Reg sales
SUN,29/01/2006,28429,CONT CHAR POTS,1072.67,632,58.61,39.38,5.46
SUN,29/01/2006,38439,ORG LGE LSE POTS,279.97,166,0.0,24.98,0.0
Please let me know if more information is required
the intranet. I am getting this error displayed.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Bulk Insert: Unexpected
end-of-file (EOF) encountered in data file.
/loaddata/file.asp, line 15
Here is a copy of the asp file
<html><head><title>Loading file</title></head><body>
<%
x = request.form("filename")
response.write "the file is = "&x
set myCon = Server.CreateObject("ADODB.Connection")
mycon.Open "NIPDB"
set myCmd = server.CreateObject("Adodb.command")
mycmd.activeconnection = mycon
mycmd.commandText = "LDS"
mycmd.commandType = 4
Set BudRS5 = mycmd.execute(,array(x))
budrs5.close
mycon.close
set mycon = nothing
%></body></html>
Here is copy of stored procedure LDS
CREATE procedure LDS(@Filein nvarchar(50)) AS
DECLARE @SQLString NVARCHAR(80)
/* Build Command*/
SET @SQLString =
N'Bulk Insert DailyTbl from ' + N'N''' + @Filein + N'''FIRSTROW = 2,
MAXERRORS = 0,
FIELDTERMINATOR = ",",
ROWTERMINATOR = "\n,\t"'
/* Execute */
EXEC (@SQLString)
GO
Here is a sample of data held within the .csv file
Day,Date,Line,Line Description,Registered Sales (£),Sales SUs,Reduced
(£),Explained Wastage,Reductions % Reg sales
SUN,29/01/2006,28429,CONT CHAR POTS,1072.67,632,58.61,39.38,5.46
SUN,29/01/2006,38439,ORG LGE LSE POTS,279.97,166,0.0,24.98,0.0
Please let me know if more information is required