| | |
conversion of text file into data base file
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2005
Posts: 134
Reputation:
Solved Threads: 10
Did you change the INSERT INTO statement to take into account the existing fields? I.e. you can no longer use Data(16), Data(17), Data(18) and Data(25) but need to adjust these subscripts, as well as the others, to reflect the existing members of the Data() array.
Also, I noticed an error on my part, I put the AMT_DUE and NAME on the same line. I have updated the definition and also added the corresponding Data() index. The data definition should be as follows:
Array pos Field Start Len
===========================================
Data(0) ACCOUNT_NO 1 10
Data(1) MOBILE_NO 11 10
Data(2) BILL_REF_NO 23 11
Data(3) OTC 35 10
Data(4) RC 46 10
Data(5) USAGE 57 10
Data(6) MISC 68 10
Data(7) ADJ 79 10
Data(8) DISC 90 10
Data(9) ST 101 10
Data(10) BILLED_AMT 112 10
Data(11) LATE_FEE 123 10
Data(12) PAYMENT 134 10
Data(13) PREV_BAL 145 10
Data(14) AMT_DUE 156 10
Data(15) NAME 167 30
Hope this helps
Yomet
Also, I noticed an error on my part, I put the AMT_DUE and NAME on the same line. I have updated the definition and also added the corresponding Data() index. The data definition should be as follows:
Array pos Field Start Len
===========================================
Data(0) ACCOUNT_NO 1 10
Data(1) MOBILE_NO 11 10
Data(2) BILL_REF_NO 23 11
Data(3) OTC 35 10
Data(4) RC 46 10
Data(5) USAGE 57 10
Data(6) MISC 68 10
Data(7) ADJ 79 10
Data(8) DISC 90 10
Data(9) ST 101 10
Data(10) BILLED_AMT 112 10
Data(11) LATE_FEE 123 10
Data(12) PAYMENT 134 10
Data(13) PREV_BAL 145 10
Data(14) AMT_DUE 156 10
Data(15) NAME 167 30
Hope this helps
Yomet
•
•
Join Date: Nov 2005
Posts: 134
Reputation:
Solved Threads: 10
jto,
You are absolutely correct in your assessement of the situation and if you look at posting #10 you will see that I already told you this, not to confuse with "told you so"...
You already have the code in your posting, it's a simple IF statement that you put around the
db.Execute "INSERT INTO Table1 (Acco[...]
statement.
You should be able to figure out the exact syntax of a simple If statement, otherwise you woudn't have gotten this far...
Happy coding
Yomet
P.S. By using this approach you do not need to skip the first lines of the data file since this condition will automatically eliminate the header from the beginning of the file.
You are absolutely correct in your assessement of the situation and if you look at posting #10 you will see that I already told you this, not to confuse with "told you so"...

You already have the code in your posting, it's a simple IF statement that you put around the
db.Execute "INSERT INTO Table1 (Acco[...]
statement.
You should be able to figure out the exact syntax of a simple If statement, otherwise you woudn't have gotten this far...

Happy coding
Yomet
P.S. By using this approach you do not need to skip the first lines of the data file since this condition will automatically eliminate the header from the beginning of the file.
•
•
Join Date: Nov 2005
Posts: 134
Reputation:
Solved Threads: 10
jto,
I cannot help you with Crystal Reports since I do not have enough experience with that but if your client(s) have Access installed you can take all the code from VB, with slight modifications, and add it to an Access databse and use the reporting tool from Access to create your reports. This still works if you will be using another database than Access as the real backend since you can use Access as the frontend instead of VB.
Otherwise I am sure there are knowledgable Crystal Reports people in this forum.
Hope this helps
Yomet
I cannot help you with Crystal Reports since I do not have enough experience with that but if your client(s) have Access installed you can take all the code from VB, with slight modifications, and add it to an Access databse and use the reporting tool from Access to create your reports. This still works if you will be using another database than Access as the real backend since you can use Access as the frontend instead of VB.
Otherwise I am sure there are knowledgable Crystal Reports people in this forum.
Hope this helps
Yomet
•
•
Join Date: Sep 2006
Posts: 54
Reputation:
Solved Threads: 1
hello sir jomet
2005/11/11 17:36:13, Event:Access, Door:entry, Card No.:1234, Description:333
2005/11/11 17:36:17, Event:Access, Door:entry, Card No.:1234, Description:333
2005/11/11 17:36:20, Event:Access, Door:entry, Card No.:2222, Description:222
2005/11/11 17:36:26, Event:Access, Door:entry, Card No.:2222, Description:222
i when i read this thread, i got my problem solve on how to save the text file in database.. i have a project which time and attendance base on textlog.. my problem is how can i save the time in two TIME IN and TIME OUT the first record is for the time in and the last record willbe for the time out, base on their card number and date..
2005/11/11 17:36:13, Event:Access, Door:entry, Card No.:1234, Description:333
2005/11/11 17:36:17, Event:Access, Door:entry, Card No.:1234, Description:333
2005/11/11 17:36:20, Event:Access, Door:entry, Card No.:2222, Description:222
2005/11/11 17:36:26, Event:Access, Door:entry, Card No.:2222, Description:222
i when i read this thread, i got my problem solve on how to save the text file in database.. i have a project which time and attendance base on textlog.. my problem is how can i save the time in two TIME IN and TIME OUT the first record is for the time in and the last record willbe for the time out, base on their card number and date..
![]() |
Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: form load
- Next Thread: HELP!Populate Datagrid using ORACLE table
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





