I am creating a table in access database (.mdb) through VB
But I am not able to set the primary key constraint through code.
I searched on the forum regarding this...but no luck.
Here's the code I am using to create the table
With the above code I am creating a table. But I want to set Id as my primary key.Code:Dim cn as New ADODB.Connection cn.Open = "DSN=MyDSN" sql = "create table Master(Id Number, Name Text) cn.Execute sql
How do I do this?




Reply With Quote