Hi,
I'm working on an application that writes records to an Access database.
What I've got so far works, but very slowly.
I have one class that creates the data -- some of it is as follows (this is
in a block that's reading data).
mFieldValues = String.Format(" Values({0},""{1}"",""{2}"",""{3}"",""{4}"")", _
.GetInt32(0), .GetString(1), .GetString(3), .GetString(4),
mMyRegion)
mAppender.AppendLine(mFieldValues)
mAppender is a class that does the writing and where the slowness appears to
be. The writing is done here:
Public Sub AppendLine(ByVal mFieldvalues As String)
dbCmd.CommandText = "INSERT INTO " & mTable & _
Me.FieldNames & mFieldvalues
dbCmd.ExecuteNonQuery()
End Sub
Does anyone have any suggestions as to what I may be doing wrong. It seems
to take about 1 minute per 500 records. I eliminated the write, and just did
the reading, that went very fast. I hard coded sample values to avoid the
..getstring stuff, that made no difference.
thanks,
Art
|