Dim cnnADO As ADODB.Connection
Dim tbl As ADOX.Table
Dim ctg As ADOX.Catalog
Private Sub Form_Load()
' Instantiate the ActiveX data objects
Set cnnADO = New ADODB.Connection
Set ctg = New ADOX.Catalog
Set tbl = New ADOX.Table
' Open the database and establish the connection
cnnADO.Open "Provider='Microsoft.Jet.OLEDB.4.0';Data Source=practice.mdb"
Set ctg.ActiveConnection = cnnADO
' Add a new column (field) and make it autoincrementing.
.Name = "Employees"
Set .ParentCatalog = ctg
.Columns.Append "EmployeeIDs", adInteger
.Columns("EmployeeIDs").Properties("AutoIncrement") = True
' Append the new column
Private Sub Form_Unload(Cancel As Integer)
Set ctg = Nothing
Set cnnADO = Nothing
Set tbl = Nothing
That should add a new autoincrement field to an existing database. But your request seems to be contradictory: alphanumeric autonumber.
Since the autonumber uses the decimal numbering system, you should only want numbers.
You'll need to add references to the ActiveX data objects library and tp the ADO ext for DDL and Security.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.