I am developing an ASP page that is connected to an ACCESS database. I need to get a maximum value for a number field, add 1 to it and use that number as a key value to start the next record.
10 Set Con = Server.CreateObject("ADODB.Connection"
20 Con.Open "accessDSN"
30 sqlInteger="SELECT MAX(OrgID) AS [id] FROM Region"
40 Con.Execute sqlInteger
50 Response.Write(id)
60 id=id+1
70 Response.Write(id)
I can manipulate the database without any problems, so my connection is OK. When I display id on line 50 I get no response, on line 70, I get 1.
There are 5 records in the database and the field is set to be a number. I need to see a number in line 50???
Any help would be greatly appreciated!
10 Set Con = Server.CreateObject("ADODB.Connection"
20 Con.Open "accessDSN"
30 sqlInteger="SELECT MAX(OrgID) AS [id] FROM Region"
40 Con.Execute sqlInteger
50 Response.Write(id)
60 id=id+1
70 Response.Write(id)
I can manipulate the database without any problems, so my connection is OK. When I display id on line 50 I get no response, on line 70, I get 1.
There are 5 records in the database and the field is set to be a number. I need to see a number in line 50???
Any help would be greatly appreciated!