Could someone help me with this VBScript error?

Discussion in 'Software' started by Jawa Slayer, Jan 14, 2007.

  1. Jawa Slayer

    Jawa Slayer Corporal

    Hi, I'm linking a database to my website and I keep getting this error:

    Microsoft VBScript compilation error '800a0409'
    Unterminated string constant
    /Connections/gillian_bryan_art_db.asp, line 2
    MM_gillian_bryan_art_db_STRING = "Driver={Microsoft Access Driver(*.mdb)};
    --------------------------------------------------------------------------^

    From this code:
    <%
    MM_gillian_bryan_art_db_STRING = "Driver={Microsoft Access Driver(*.mdb)};
    DBQ=d:\hosting\*my username*\access_db\gillian_bryan_art.mdb"
    %>

    I think the error means i've left out a bracket or something but I can't figure out where.

    p.s. the arrow should be pointing to the end of the line but it dosn't on this site for some reason.
     
  2. Mada_Milty

    Mada_Milty MajorGeek

    It's your string! Because it breaks across two lines, you need something to signify it. the following code should work (additions are in red):
    Code:
    MM_gillian_bryan_art_db_STRING = "Driver={Microsoft Access Driver(*.mdb)};[COLOR="Red"]" & _ 
    "[/COLOR]DBQ=d:\hosting\*[I]my username[/I]*\access_db\gillian_bryan_art.mdb"
    Use the ampersand to concatenate the two strings, and underscore to carry the command (variable assignment in this case) across two lines. See this link for further information.
     
  3. Jawa Slayer

    Jawa Slayer Corporal

    That fixed the problem.
    Thanks!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds