Unanswered: Team_ID Automatic Generation stuck at 999
I have a piece of code in ASP which automatically generated as team_id as teams are added by users and stores team_id value in sql database. This code was working fine until team_ID value reached tm_999 after that this piece of code is allocating team_Id for every team added as tm_* instead of going to tm_1000. Can anybody tell what should i change in order to fix this problem?
'*********** This is code for sequence generation for Team id.
set cmd_nextval = server.CreateObject ("ADODB.command")
set p1 = server.CreateObject ("ADODB.Parameter")
set p2 = server.CreateObject ("ADODB.Parameter")
const adCmdStoredProc = &H0004
const adChar = 129
const adParamInput = &H0001
const adParamOutput = &H0002
cmd_Nextval.ActiveConnection = objConn
cmd_Nextval.CommandText = "NEXTVAL"
cmd_Nextval.CommandType = adCmdStoredProc
p1.name = "@seqname"
p1.type = adChar
p1.direction = adParamInput
p1.size = 50
p1.value = "TEAM"
p2.name = "@pre"
p2.type = adChar
p2.direction = adParamOutput
p2.size = 50
team_id = p2.Value ' = cmd_Nextval.NamedParameters("pre")
team_id = trim(team_id)
actually this is an old website baed on classic asp which i have not written, i m just managing it, so after going through all the code, i found out that this piece of code was causing problem, so i thought if i can edit it and let it do the same thing.
If that's possible for you to tell because there is lots of places where there is a reference to this id and i dont want to mess anything up
the asp does not have a count in there it must be in the StoredProc in the SQL database
and it probabley a varibles is set to the lenght of 3
I would look for
DECLARE @???????? varchar(3)
in the StoredProc
??????? being a var name
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.