J
Jared
Hello all,
I don't believe I forgot how to do this, I want to add a new record to a new
access database and I cannot remember how to do this.
I have a connection object which opens and closes correctly. What do I have
to do to get that pesky little record into the database? I have tried
several ways and nothing seems to be working for me.
If someone would be kind enough to include a small example to insert a
single item into a database I would be very grateful. I haven't worked with
databases since vb6, I've been using mostly XML, the problem with this is I
am parsing SUS (software update service) log files in excess of 25MB that is
several hundred thousand records, I really need to be able to search and
manipulate it quickly.
Thanks in advance,
Jared
Here is one of my tries that went nowhere.
'Dim dt As DataTable = Me.MyDataSet.Tables("tblClientDetails")
Dim dt As DataTable = MyTable
Dim MyRow As DataRow
MyRow = dt.NewRow
MyRow("PingID") = NewRecord.Details.PING_ID
MyRow("DateServiced") = NewRecord.DateServiced
MyRow("TimeServiced") = NewRecord.TimeServiced
MyRow("RequestingIP") = NewRecord.RequestingIP
MyRow("ServicingIP") = NewRecord.ServicingIP
MyRow("VERSION") = NewRecord.Details.VERSION
MyRow("CLIENT") = NewRecord.Details.CLIENT
MyRow("ACTIVITY") = NewRecord.Details.ACTIVITY
MyRow("ITEM") = NewRecord.Details.ITEM
MyRow("DEVICE") = NewRecord.Details.DEVICE
MyRow("MAJ_VERSION") = NewRecord.Details.PLATFORM.MAJ_OS_VER
MyRow("MIN_VERSION") = NewRecord.Details.PLATFORM.MIN_OS_VER
MyRow("BUILD_NUM") = NewRecord.Details.PLATFORM.BUILD_NUM
MyRow("PLAT_ID") = NewRecord.Details.PLATFORM.PLAT_ID
MyRow("SUITE_MASK") = NewRecord.Details.PLATFORM.SUITE_MASK
MyRow("PROD_TYPE") = NewRecord.Details.PLATFORM.PROD_TYPE
MyRow("PROCESSOR_ARCH") = NewRecord.Details.PLATFORM.PROCESSOR_ARCH
MyRow("LANGUAGE") = NewRecord.Details.LANGUAGE
MyRow("STATUS") = NewRecord.Details.STATUS
MyRow("ERRORCode") = NewRecord.Details.ERRORCode
MyRow("MESSAGE") = NewRecord.Details.MESSAGE
MyRow("PROXY") = NewRecord.Details.PROXY
dt.Rows.Add(MyRow)
I don't believe I forgot how to do this, I want to add a new record to a new
access database and I cannot remember how to do this.
I have a connection object which opens and closes correctly. What do I have
to do to get that pesky little record into the database? I have tried
several ways and nothing seems to be working for me.
If someone would be kind enough to include a small example to insert a
single item into a database I would be very grateful. I haven't worked with
databases since vb6, I've been using mostly XML, the problem with this is I
am parsing SUS (software update service) log files in excess of 25MB that is
several hundred thousand records, I really need to be able to search and
manipulate it quickly.
Thanks in advance,
Jared
Here is one of my tries that went nowhere.
'Dim dt As DataTable = Me.MyDataSet.Tables("tblClientDetails")
Dim dt As DataTable = MyTable
Dim MyRow As DataRow
MyRow = dt.NewRow
MyRow("PingID") = NewRecord.Details.PING_ID
MyRow("DateServiced") = NewRecord.DateServiced
MyRow("TimeServiced") = NewRecord.TimeServiced
MyRow("RequestingIP") = NewRecord.RequestingIP
MyRow("ServicingIP") = NewRecord.ServicingIP
MyRow("VERSION") = NewRecord.Details.VERSION
MyRow("CLIENT") = NewRecord.Details.CLIENT
MyRow("ACTIVITY") = NewRecord.Details.ACTIVITY
MyRow("ITEM") = NewRecord.Details.ITEM
MyRow("DEVICE") = NewRecord.Details.DEVICE
MyRow("MAJ_VERSION") = NewRecord.Details.PLATFORM.MAJ_OS_VER
MyRow("MIN_VERSION") = NewRecord.Details.PLATFORM.MIN_OS_VER
MyRow("BUILD_NUM") = NewRecord.Details.PLATFORM.BUILD_NUM
MyRow("PLAT_ID") = NewRecord.Details.PLATFORM.PLAT_ID
MyRow("SUITE_MASK") = NewRecord.Details.PLATFORM.SUITE_MASK
MyRow("PROD_TYPE") = NewRecord.Details.PLATFORM.PROD_TYPE
MyRow("PROCESSOR_ARCH") = NewRecord.Details.PLATFORM.PROCESSOR_ARCH
MyRow("LANGUAGE") = NewRecord.Details.LANGUAGE
MyRow("STATUS") = NewRecord.Details.STATUS
MyRow("ERRORCode") = NewRecord.Details.ERRORCode
MyRow("MESSAGE") = NewRecord.Details.MESSAGE
MyRow("PROXY") = NewRecord.Details.PROXY
dt.Rows.Add(MyRow)