Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    Cleveland, Ohio
    Posts
    182

    ASP Replace Function Question

    Hello,

    I am using a replace function like

    -------------------------------------------------------------------------

    strLastName = "John"
    strResults = Replace(strResults, "[LastName]", RS("LastName"))

    --------------------------------------------------------------------------

    The RS("LastName") database field equals strLastName

    Instead of it calling the strLastName into the function like it should print our "John" it will just print out strLastName.

    If I do not use the recordset and use strLastName inplace of the RS("LastName") it works good, just doesn't work with the option getting the info from a database.

    If anyone can help, it will be greatly appreiated, been trying to figure this out for hours now.
    SepCity.com - Content Management / Portal Software Solutions
    Host on our network or buy our software to host on your own server

  2. #2
    Join Date
    Mar 2004
    Location
    Cleveland, Ohio
    Posts
    182
    Thanks for your response, but I figured out another solution that works good, just using variable. The object from that code was to do a find and replace using a database field as a variable to call a function which would not work so I just had to do some work-a-rounds to find a solutions that worked.

    Thanks anyways.
    SepCity.com - Content Management / Portal Software Solutions
    Host on our network or buy our software to host on your own server

  3. #3
    Join Date
    Mar 2003
    Location
    sf
    Posts
    350
    does your RS("LastName") get the correct data from db?

    I can't say much if i don't see the whole script.

  4. #4
    Join Date
    Mar 2004
    Location
    Cleveland, Ohio
    Posts
    182

    Smile

    Yeah I did a test and just did a response.write and it wrote what I wanted.

    Say if the replaced word is "CallFunction" from the database, instead of it writing the contents inside of the function it wil just do a write "CallFunction". Somehow there has to be a way to declare whatever the field is writing so it knows to call that function instead of writing the text.

    I hope that is easier to understand
    SepCity.com - Content Management / Portal Software Solutions
    Host on our network or buy our software to host on your own server

Posting Permissions

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