WayneS
October 27th, 2004, 07:04 PM
Hi,
I am new to database programing and have this problem I can't find an answer to. This is the code I am using.
[CODE]
Set conData = New ADODB.Connection
conData.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\data.mdb"
strSQL = "CREATE TABLE League (" & _
"ID Integer NOT NULL IDENTITY(1,1) PRIMARY KEY," & _
"LeagueName Varchar(50)," & _
"BowlingCenter Varchar(50));"
conData.Execute strSQL
Set conData = Nothing
[CODE]
However when I add data the ID (primary key) does not increment. All my ID's are 1.
What am I doing wrong?
Thanks for your help.
Wayne
I am new to database programing and have this problem I can't find an answer to. This is the code I am using.
[CODE]
Set conData = New ADODB.Connection
conData.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\data.mdb"
strSQL = "CREATE TABLE League (" & _
"ID Integer NOT NULL IDENTITY(1,1) PRIMARY KEY," & _
"LeagueName Varchar(50)," & _
"BowlingCenter Varchar(50));"
conData.Execute strSQL
Set conData = Nothing
[CODE]
However when I add data the ID (primary key) does not increment. All my ID's are 1.
What am I doing wrong?
Thanks for your help.
Wayne