March 17th, 2013, 02:59 PM
[RESOLVED] fill a database with numbers
Hi fellow programmers. I am trying to do what I thought was a very simple task in VB6 and Access and am pulling my hair out.
What I want to to is fill an Access table with four fields labeled Num1 through Num4 with all sets of four numbers from one to one hundred. For exampleL 1-2-3-4; 1-2-3-5; 1-2-3-6 etc.
I have the for - next loops easily enough . The four text boxes are bound to the number table in the database. My problem is I cannot insert each set of four numbers into the database. Any help is appreciated.
Here is my code for generating the numbers...
For a = 1 to 97
For b = a + 1 to 98
For c = b + 1 to 99
For d = c + 1 to 100
' Here is where I want to put the numbers into the Access database table.
'I am using the ADO data control and have a reference to ADO 2.0 in the progect.
I've tried different things and just get errors and can't figure out what I am doing wrong. Please hep. Thanks.
Tags for this Thread
Click Here to Expand Forum to Full Width