|
-
Jun 29th, 2000, 04:33 AM
#1
Thread Starter
Lively Member
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
-
Jun 29th, 2000, 08:26 AM
#2
Guru
what is the value of rstcand("ADDRESS_ID")?
try this:
strLastRecord = cint(rstcand("ADDRESS_ID"))
-
Jun 30th, 2000, 04:05 PM
#3
Thread Starter
Lively Member
figured it out
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|