Hi guys,
put this code on a command button and run it. if your Database won't be 49 Mb++ tell me the references you used coz mine is that big.Just re-align the lines below. Here goes:
Private Sub Command1_Click()
Dim intger As Integer
Dim cat As New ADOX.Catalog
Dim tabl As New ADOX.Table
Dim con As New ADODB.Connection
Dim rec As New ADODB.Recordset
'create a database and a table in it
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb"
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb"
With tabl
.Name = "testtable"
.Columns.Append "col1", adVarWChar
.Columns.Append "col2", adVarWChar
End With
cat.Tables.Append tabl
Set tabl = Nothing
Set cat = Nothing
'create a connection to the Database the add data to it
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb"
rec.Open "testtable", con, adOpenDynamic, adLockOptimistic
For intger = 0 To 12000
rec.AddNew
rec!col1 = intger
rec!col2 = CStr(intger) & CStr(intger) 'anything to be inserted
Next intger
rec.Update
rec.Close
con.Close
Set rec = Nothing
Set con = Nothing
Unload Me
End Sub
put this code on a command button and run it. if your Database won't be 49 Mb++ tell me the references you used coz mine is that big.Just re-align the lines below. Here goes:
Private Sub Command1_Click()
Dim intger As Integer
Dim cat As New ADOX.Catalog
Dim tabl As New ADOX.Table
Dim con As New ADODB.Connection
Dim rec As New ADODB.Recordset
'create a database and a table in it
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb"
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb"
With tabl
.Name = "testtable"
.Columns.Append "col1", adVarWChar
.Columns.Append "col2", adVarWChar
End With
cat.Tables.Append tabl
Set tabl = Nothing
Set cat = Nothing
'create a connection to the Database the add data to it
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb"
rec.Open "testtable", con, adOpenDynamic, adLockOptimistic
For intger = 0 To 12000
rec.AddNew
rec!col1 = intger
rec!col2 = CStr(intger) & CStr(intger) 'anything to be inserted
Next intger
rec.Update
rec.Close
con.Close
Set rec = Nothing
Set con = Nothing
Unload Me
End Sub