Results 1 to 4 of 4

Thread: Split() not working

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    Rhode Island, USA
    Posts
    2

    Unhappy Split() not working

    Hello,

    I'm using VBScript to read an entry from Access using the following code:

    dim ProdColor(100) As Variant
    dim holdcolor
    RS.MoveFirst
    holdcolor = RS("Color")
    ProdColor() = Split(holdcolor)

    it returns:

    Microsoft VBScript compilation error '800a0401'
    Expected end of statement
    detail.asp, line 47
    dim ProdColor(100) As Variant
    -------------------^

    I've browsed this forum, it appears I'm coding properly.
    Any help?

    thanks
    AGB

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    2 amiss here:

    dim ProdColor(100) As Variant <-- don't 'size' the array and don't declare 'As Variant'

    This will do nicely!
    dim ProdColor()
    Mark
    -------------------

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    One more...

    ProdColor() = Split(holdcolor)

    should be

    ProdColor = Split(holdcolor)
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    Rhode Island, USA
    Posts
    2

    Smile Up & running

    I'm up & running, thank you all.

    AGB

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