Type Mismatch

Results 1 to 8 of 8

Thread: Type Mismatch

  1. #1
    Join Date
    Dec 1969

    Default Type Mismatch

    Right now, my clients need a number placed on the page, (i.e. CI-X-01-001) The X is going to be replaced by their input, the 01 is the current year, and the 001 is the auto increment. I have everything working but the auto increment, I can&#039;t figure out, currently I am trying to grab the latest record and assign the number to a variable, then raise the auto increment one point, then display.<BR><BR>My Connection and grabbing the recordset data<BR><BR>&#039;Open the connection and the recordset<BR> Dim objConn<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.Open "DRIVER=SQL Server;SERVER=ffsweb;UID=FunkDB_User;PWD=FunkDB_Us er"<BR> <BR> Dim objRS<BR> Set objRS = Server.CreateObject("ADODB.Recordset")<BR> objRS.Open "SELECT * FROM tblIncoming ORDER BY CorrID DESC", objConn,1,2<BR> <BR> Dim intCorr<BR> intCorr = objRS("CorrID")<BR> intCorr = intCorr + 1<BR><BR><BR>My Display Code at the bottom of the page<BR><BR>Response.Write "CI-X-" & Right(Year(Date), 2) & "-" & intCorr <BR><BR>Why does this bring up type mismatch, and how to I change it to an integer?<BR><BR>Thanks!<BR>

  2. #2
    Join Date
    Dec 1969

    Default ...

    Dim intCorr<BR>intCorr = objRS("CorrID")<BR>intCorr = CLng(intCorr) + 1

  3. #3
    Join Date
    Dec 1969

    Default Thanks

    Thanks, worked like a charm. =c)

  4. #4
    Spelling Sheriff Guest

    Default RE: Type Mismatch

    &#062;how to I change it <BR><BR>Correction: how do I change it

  5. #5
    Stupid Genuis Guest

    Default Once funny, twice a joke

    third time irritating.<BR><BR>Brain Power.

  6. #6
    django reinhardt Guest

    Default LOL...


  7. #7
    Join Date
    Dec 1969

    Default DOH!

    That was <BR><BR>Once a joke, twice funny, third time irritating.<BR><BR>Brain Power.

  8. #8
    Logic Police Guest

    Default tsk, tsk, tsk <eop>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts