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
One more thing, if it still bugs out, please send you new code and tell me which line is giving you the error. You can find that out by selecting "Debug" when the program crashes. The line in question will be highlighted in yellow.
yomet ,
again we r getting the same problem script out of range in the line Data(0) = Mid(InLine, 1, 10) it showing that 'script out of range ' when i am taking the cursor on Data(0) in debug mode .I am sending the new code as attachment
hello yomet
thank u ,from this code is working perfectly . but if text file having any header information it is also updating in data base .can we apply a condition that if data(0)='Account_no" or "-----" skip that line .
pls suggest me the condition code.
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.
Yomet ,
one thing more i want to take the required database report in a particular format , can we use crystal report . i heard that it is very good report genration tool . can u help me . if not can we take the report from vb also.
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.
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..
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline:form load