Zexor
Well-known member
- Joined
- Nov 28, 2008
- Messages
- 520
- Programming Experience
- 3-5
I am trying to create an access database file with this query
then insert data into it with this query
That worked fine. But i want to add a primary key to it, how should i change my query? the create table one will be like this? insert data unchanged? but it doesnt seem to work right after i changed it
VB.NET:
Dim oQuery As String = "CREATE TABLE " & table & _
" (Type TEXT(10) NOT NULL," & _
"Data TEXT(50) NOT NULL," & _
"Data2 TEXT(50) NOT NULL)"
VB.NET:
Dim oQuery As String = "insert into " & table & _
" values('" & type & _
"','" & data & _
"','" & data2 & "')"
VB.NET:
Dim oQuery As String = "CREATE TABLE " & table & _
" (Type TEXT(10) NOT NULL," & _
"Data TEXT(50) NOT NULL," & _
"Data2 TEXT(50) NOT NULL," & _
"PRIMARY KEY(Type) )"
Last edited: