Runescope
Well-known member
- Joined
- Jan 6, 2011
- Messages
- 53
- Programming Experience
- Beginner
I added this into my code:
It successfully makes the field 'RenewDate' the primary key, but it DOESN'T make the field a text field, which is necessary apparently as it started off as a Memo field, and Memo fields can't be primary keys for some reason. At least my program keeps crashing as long as it's still a memo field.
Sooooooo, now I need to figure out how to change the primary column to a Text field instead of a Memo field. Or am I just doing this in the wrong order? Change to primary and then to text?
dbCMD = New OleDbCommand("ALTER TABLE [RegTable] ALTER COLUMN [RenewDate] Text", Conn) dbCMD.ExecuteNonQuery() dbCMD = New OleDbCommand("ALTER TABLE [RegTable] ADD PRIMARY KEY(RenewDate)", Conn) dbCMD.ExecuteNonQuery()
It successfully makes the field 'RenewDate' the primary key, but it DOESN'T make the field a text field, which is necessary apparently as it started off as a Memo field, and Memo fields can't be primary keys for some reason. At least my program keeps crashing as long as it's still a memo field.
Sooooooo, now I need to figure out how to change the primary column to a Text field instead of a Memo field. Or am I just doing this in the wrong order? Change to primary and then to text?
Last edited: