PDA

Click to See Complete Forum and Search --> : Type mismatch error


scottr
Jun 29th, 2000, 04:33 AM
hi i wanted to create a recordset so that i could get the last record to find out the primary key. I wanted to use this record and add 1 to it to get the primary key of the next record. This is done to mirror an access datbase to reflect the oracle environment. However i keep getting the following error:



Microsoft VBScript runtime error '800a000d'

Type mismatch: 'Cint'

/App/app.asp, line 109


it doesnt regonize the cint. Any hints on what could be causing this.

Regards Scott


sub lastAddOpen
dim rstCand
dim qryCand
dim strLastRecord
'dim intcandID

set rstCand=server.CreateObject("ADODB.Recordset")
qryCand="select * from HRR_Address"

rstcand.Open qryCand,dbconn,adOpenKeyset
'set rstCand=dbConn.Execute(qryCand)
if not emptyRS(rstCand) then
rstcand.movelast
strLastRecord = rstcand("ADDRESS_ID")
rstcand.Close
set rstcand=nothing

end if
intcandID = Cint(strLastRecord) + 1
Response.Write intcandID
end sub

Clunietp
Jun 29th, 2000, 08:26 AM
what is the value of rstcand("ADDRESS_ID")?

try this:
strLastRecord = cint(rstcand("ADDRESS_ID"))

scottr
Jun 30th, 2000, 04:05 PM
I was getting the error because of the way i was accessing the variable intcandID . I had to declare it at the top of the page that way i could use it in a querry that i was writing as the variable. I figured it out but ended up doing something different anyway. Oh well. thanks for the help.

Regards,

scott