Results 1 to 3 of 3

Thread: Type mismatch error

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Posts
    89
    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

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    what is the value of rstcand("ADDRESS_ID")?

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


  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Posts
    89

    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
  •  



Click Here to Expand Forum to Full Width