P
Paul Ilacqua
I have spent the last 7 years doing things like this... relatively simple.
Now with the move to .NET I'm lost. Can someone give me a headstart on how
to do this in vb.net. I appreciate any help I can get I learn the best from
having a working model and then expanding on it.
Function InsertFlat() As Long
Dim s As String
Dim iLine As Long
Dim n
Dim i As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Dim iFile As Integer
Set rs = db.OpenRecordset("ActiveInventory_ITEMS")
db.Execute "Delete * From ActiveInventory_ITEMS"
iFile = FreeFile
Open "C:\AAAA\ActiveInventory_ITEMS.dat" For Input As #iFile
Do Until EOF(iFile)
Line Input #iFile, s
n = Split(s, vbTab)
rs.AddNew
For i = 0 To UBound(n) -1
rs(i) = C_Null(RTrim$(n(i)))
Next i
rs.Update
iLine = iLine + 1
Loop
Close #iFile
InsertFlat = iLine
End Function
Now with the move to .NET I'm lost. Can someone give me a headstart on how
to do this in vb.net. I appreciate any help I can get I learn the best from
having a working model and then expanding on it.
Function InsertFlat() As Long
Dim s As String
Dim iLine As Long
Dim n
Dim i As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Dim iFile As Integer
Set rs = db.OpenRecordset("ActiveInventory_ITEMS")
db.Execute "Delete * From ActiveInventory_ITEMS"
iFile = FreeFile
Open "C:\AAAA\ActiveInventory_ITEMS.dat" For Input As #iFile
Do Until EOF(iFile)
Line Input #iFile, s
n = Split(s, vbTab)
rs.AddNew
For i = 0 To UBound(n) -1
rs(i) = C_Null(RTrim$(n(i)))
Next i
rs.Update
iLine = iLine + 1
Loop
Close #iFile
InsertFlat = iLine
End Function