"Niraj Khandwala" <kn****@vsnl.net> wrote in message
news:uu**************@TK2MSFTNGP12.phx.gbl...
hey, Chris thanks,
here are the details
IIS5.0 , SQL Server 2000, No DLL used.
Sample code :
----------------------------------------
set oTs = oFs.OpenTextFile(strFileName)
con.BeginTrans
On Error resume next
do while oTs.AtEndOfStream = False
strLine = oTs.ReadLine
strArray = split(strLine,"|")
if ubound(strArray) > 0 then
rst("txt_idcode") = ltrim(strArray(0))
rst("nbr_micr") = strarray(1)
rst("amt_chkamt") = cdbl(strarray(2))
rst("cod_state") = ltrim(strarray(3))
blah blah ...
Loop
if Err.number <> 0
do error handling and roll back. but this does not show proper errors /
line number / column number and ADODB errors do not even redirect to my
custom error page :(
end if
1. DLL stands for Data Definition Language or Data Declaration Language
depending on who you talk to. Regardless, it boils down to providing the
CREATE TABLE, CREATE INDEX, etc.. statements necessary to reproduce your
environment. That coupled with some sample data allows us to provide a
concrete solution instead of having to guess at what "blah blah..." means.
Here's an article:
http://aspfaq.com/etiquette.asp?id=5006
2. I'm assuming the rst is a ADODB.Recordset object. If so, you shouldn't be
using a recordset to perform DML (Data Manipulation Language such as INSERT,
UPDATE and DELETE). Use the Execute method of the connection object or the
"procedure-as-method" option. Here's another article:
http://aspfaq.com/show.asp?id=2191
3. This is almost certainly something that should be done with DTS (Data
Transformation Services) or BCP (Bulk Copy) is SQL Server. Please read the
related sections in BOL (Books Online).
4. If after all this you are still hell-bent on using this approach you will
need to inspect the ADODB.Connection.Errors collection instead of the Err
object. You will also need to define variables for current row and column as
you iterate through the source data. After each line that could possibly
generate an error, you will need to check the ADODB>Connection.Errors
collection and branch accordingly. As for transactions, I'm not sure DML via
a ADODB.Recordset object can participate in one. Another reason to rethink
the insert-via-recordset approach.
Sorry I couldn't be more help.