J
joten
Hello I'll try to explain you a problem that I have with my database.
I have a file (FILE.TXT) with the following fields:
INVOICE-AMOUNT-CUSTOMER-DATE
I'm trying to as data are read from the file, the records that fulfil
a condition they are added to a table with the same fields that abov
mentioned.
In order to directly add data in a table, before I have used thi
code:
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = CodeProject.Connection
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "TABLENAME"
.Open options = adCmdTableDirect
.AddNew
!invoice = file.invoice
!amount = file.amount
!customer = file.customer
!date = file.date
.Update
.Close
End With
Set rst = Nothing
The problem that I have now is that I don't know where in the abov
code, to include the code that it allows to me to get records from th
file and to verify if they fulfill the necessary conditions.
The code is something like this:
Open "c:\file.txt" For Random As #1 Len = 82
For i = 1 To LOF(1) / 82
Get #1, i, recordfile
If ........ Then
Else
End If
Next
Thank you in advance
I have a file (FILE.TXT) with the following fields:
INVOICE-AMOUNT-CUSTOMER-DATE
I'm trying to as data are read from the file, the records that fulfil
a condition they are added to a table with the same fields that abov
mentioned.
In order to directly add data in a table, before I have used thi
code:
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = CodeProject.Connection
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "TABLENAME"
.Open options = adCmdTableDirect
.AddNew
!invoice = file.invoice
!amount = file.amount
!customer = file.customer
!date = file.date
.Update
.Close
End With
Set rst = Nothing
The problem that I have now is that I don't know where in the abov
code, to include the code that it allows to me to get records from th
file and to verify if they fulfill the necessary conditions.
The code is something like this:
Open "c:\file.txt" For Random As #1 Len = 82
For i = 1 To LOF(1) / 82
Get #1, i, recordfile
If ........ Then
Else
End If
Next
Thank you in advance