Cant remember very well but think goes like this.
You first make a recordset which will hold the input
RecordsetName![FieldName] = ControlContents
write a sub UpdateRecord
here u will call the recordset.update method
This will have called another sub that will actually populate the recordset WritetoRecordset using the syntax
RecordsetName![FieldName] = ControlContents (if the text controls then .txt.

sub UpdateRecord
WriteToRecordset
recordset.update
End sub

Sub WriteToRecord
RecordsetName![FieldName] = F_Name.txt
RecordsetName![FieldName] = l_Name.txt
RecordsetName![FieldName] = phone.txt
End sub

This sub will be called from the save button once the form has been populated.

The connection object has to be instantiated and available as that is what the recordset is going to use. The cn obj holds the parameters that will be used to wirte back to the db.

Hope that helps

On Mon, Jul 26, 2010 at 5:31 PM, Rad! <conradakunga@gmail.com> wrote:
Seems pretty straightforward.

Can't remember with 100% certainty but i think what you want to do is open the file and loop through each line.

For each line execute the Split command, passing as a parameter the semicolon. This should give you an array of 4 strings

You can then write a simple loop to iterate over the array and insert the values into the database.

On Mon, Jul 26, 2010 at 4:05 PM, Charles Mwangi <mwangicharles@gmail.com> wrote:
Hi VB gurus out there,

Kindly provide code for loading the following test script into an access db using visual basic 6

TT10194C2ASD;6700;254722090909;CharlesMwangi;
TT10194C5PST;9034;254722123123;MikeMaingi;

the text has 4 fields separated by semi colons.

The first 3 fields are of fixed length values.

thanks.

_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke


_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke



--
"Humility grows a little more each time i genuinely listen to the experience of another human being". Brahma Kumaris