Hi,
I would like to create a table using the For/Do loop because the table name is similar except for the last postion which can contain values 1 to 4. Below is my current code:
strCMD = "CREATE TABLE WEEK1 (" & _
"TGSN varchar (8)," & _
"MEAS_PRD varchar (2)," & _
"[HOUR] int," & _
"MCDA varchar (5)," & _
"OFFDCCS varchar (7)," & _
"BLKG varchar (7))"
cmdDatabase = New OleDbCommand(strCMD, cnn)
cmdDatabase.ExecuteNonQuery()
strCMD = "CREATE UNIQUE INDEX PrimaryKeyWEEK ON WEEK1([HOUR])"
cmdDatabase = New OleDbCommand(strCMD, cnn)
cmdDatabase.ExecuteNonQuery()
I am creating four tables, Week1, Week2, Week3 and Week4. So, instead of having four sets of code I would like to have one and somehow change the week number from static to a variable.
Any one have any idease?
I would like to create a table using the For/Do loop because the table name is similar except for the last postion which can contain values 1 to 4. Below is my current code:
strCMD = "CREATE TABLE WEEK1 (" & _
"TGSN varchar (8)," & _
"MEAS_PRD varchar (2)," & _
"[HOUR] int," & _
"MCDA varchar (5)," & _
"OFFDCCS varchar (7)," & _
"BLKG varchar (7))"
cmdDatabase = New OleDbCommand(strCMD, cnn)
cmdDatabase.ExecuteNonQuery()
strCMD = "CREATE UNIQUE INDEX PrimaryKeyWEEK ON WEEK1([HOUR])"
cmdDatabase = New OleDbCommand(strCMD, cnn)
cmdDatabase.ExecuteNonQuery()
I am creating four tables, Week1, Week2, Week3 and Week4. So, instead of having four sets of code I would like to have one and somehow change the week number from static to a variable.
Any one have any idease?