Frustrating problem with connection string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sjanie

    Frustrating problem with connection string


    The error code is:

    Microsoft JScript compilation error '800a03ec'

    Expected ';'

    /bicc.nl/Connections/BICCwebsite.asp , line 2

    Set Conn = Server.CreateOb ject("ADODB.Con nection")
    ----^

    The connectionstrin g I'm using:

    %
    Set Conn = Server.CreateOb ject("ADODB.Con nection")
    DSNtest="DRIVER ={Microsoft Access Driver (*.mdb)}; "
    DSNtest=dsntest & "DBQ=" & Server.MapPath( "../../cgi-bin/bicc.mdb")
    Conn.Open DSNtest
    %

    In combination with (a part of) the following codepage:

    %@LANGUAGE="JAV ASCRIPT" CODEPAGE="1252" %
    !--#include file="Connectio ns/BICCwebsite.asp " --
    %
    var Recordset1 = Server.CreateOb ject("ADODB.Rec ordset")
    Recordset1.Acti veConnection = DSNtest
    Recordset1.Sour ce = "SELECT * FROM Nieuws ORDER BY Datum DESC"
    Recordset1.Curs orType = 2
    Recordset1.Curs orLocation = 2
    Recordset1.Lock Type = 1
    Recordset1.Open ()
    var Recordset1_numR ows = 0
    %
    %
    var Repeat1__numRow s = 4;
    var Repeat1__index = 0;
    Recordset1_numR ows += Repeat1__numRow s;
    %
    % var MM_paramName = ""; %
    %
    // *** Go To Record and Move To Record: create strings for maintainin
    URL and Form parameters

    // create the list of parameters which should not be maintained
    var MM_removeList = "&index=";
    if (MM_paramName != "") MM_removeList += "&"
    MM_paramName.to LowerCase() + "=";
    var MM_keepURL="",M M_keepForm="",M M_keepBoth="",M M_keepNone="";

    // add the URL parameters to the MM_keepURL string
    for (var items=new Enumerator(Requ est.QueryString ); !items.atEnd()
    items.moveNext( )) {
    var nextItem = "&" + items.item().to LowerCase() + "=";
    if (MM_removeList. indexOf(nextIte m) == -1) {
    MM_keepURL += "&" + items.item() + "="
    Server.URLencod e(Request.Query String(items.it em()));
    }
    }

    // add the Form variables to the MM_keepForm string
    for (var items=new Enumerator(Requ est.Form); !items.atEnd()
    items.moveNext( )) {
    var nextItem = "&" + items.item().to LowerCase() + "=";
    if (MM_removeList. indexOf(nextIte m) == -1) {
    MM_keepForm += "&" + items.item() + "="
    Server.URLencod e(Request.Form( items.item()));
    }
    }

    // create the Form + URL string and remove the intial '&' from each o
    the strings
    MM_keepBoth = MM_keepURL + MM_keepForm;
    if (MM_keepBoth.le ngth 0) MM_keepBoth = MM_keepBoth.sub string(1);
    if (MM_keepURL.len gth 0) MM_keepURL = MM_keepURL.subs tring(1);
    if (MM_keepForm.le ngth 0) MM_keepForm = MM_keepForm.sub string(1);
    %
    !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    SCRIPT RUNAT=SERVER LANGUAGE=VBSCRI PT
    function DoDateTime(str, nNamedFormat, nLCID)
    dim strRet
    dim nOldLCID

    strRet = str
    If (nLCID -1) Then
    oldLCID = Session.LCID
    End If

    On Error Resume Next

    If (nLCID -1) Then
    Session.LCID = nLCID
    End If

    If ((nLCID 0) Or (Session.LCID = nLCID)) Then
    strRet = FormatDateTime( str, nNamedFormat)
    End If

    If (nLCID -1) Then
    Session.LCID = oldLCID
    End If

    DoDateTime = strRet
    End Function
    /SCRIPT
    html
    head
    title/title
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
    meta http-equiv="title" content="Aromas ys"
    meta http-equiv="Content-Language" content="NL"
    meta name="Author" content=""
    meta name="Distribut ion" content="GLOBAL "
    meta name="Revisit-After" content="14 days"
    meta name="keywords" content="."
    script language="JavaS cript" type="text/JavaScript"
    !--
    !--
    function MM_preloadImage s() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0
    ia.length; i++)
    if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image
    d.MM_p[j++].src=a[i];}}
    }

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document
    if((p=n.indexOf ("?"))0&&parent .frames.length) {
    d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&id.for ms.length;i++
    x=d.forms[i][n];
    for(i=0;!x&&d.l ayers&&id.layer s.length;i++
    x=MM_findObj(n, d.layers[i].document);
    if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
    }

    function MM_nbGroup(even t, grpName) { //v6.0
    var i,img,nbArr,arg s=MM_nbGroup.ar guments;
    if (event == "init" && args.length 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
    img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
    if ((nbArr = document[grpName]) == null) nbArr =
    document[grpName] = new Array();
    nbArr[nbArr.length] = img;
    for (i=4; i args.length-1; i+=2) if ((img = MM_findObj(args[i]))
    != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = img.MM_dn = args[i+1];
    nbArr[nbArr.length] = img;
    } }
    } else if (event == "over") {
    document.MM_nbO ver = nbArr = new Array();
    for (i=1; i args.length-1; i+=3) if ((img = MM_findObj(args[i]))
    != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?
    args[i+1] : img.MM_up);
    nbArr[nbArr.length] = img;
    }
    } else if (event == "out" ) {
    for (i=0; i document.MM_nbO ver.length; i++) {
    img = document.MM_nbO ver[i]; img.src = (img.MM_dn) ? img.MM_dn :
    img.MM_up; }
    } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
    for (i=0; i nbArr.length; i++) { img=nbArr[i]; img.src =
    img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i args.length-1; i+=2) if ((img = MM_findObj(args[i]))
    != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
    nbArr[nbArr.length] = img;
    } }
    }
    //--
    /script
    link href="tekst.css " rel="stylesheet " type="text/css"
    /head


    I think I'm mixing up VBscript with Javascript but where?
    Thanks in advance! A beginner...


    --
    sjanie
  • Jason Brown [MSFT]

    #2
    Re: Frustrating problem with connection string

    The page's language is set to JavaScript, but that "set" snippet is
    VBScript. In view of this, don't you think the problem is actually pretty
    clear?

    ;-)


    --
    Jason Brown
    Microsoft GTSC, IIS

    This posting is provided "AS IS" with no warranties, and confers no
    rights.

    "sjanie" <sjanie.1eeozr@ news.webfrustra tion.com> wrote in message
    news:sjanie.1ee ozr@news.webfru stration.com...[color=blue]
    >
    > The error code is:
    >
    > Microsoft JScript compilation error '800a03ec'
    >
    > Expected ';'
    >
    > /bicc.nl/Connections/BICCwebsite.asp , line 2
    >
    > Set Conn = Server.CreateOb ject("ADODB.Con nection")
    > ----^
    >
    > The connectionstrin g I'm using:
    >
    > %
    > Set Conn = Server.CreateOb ject("ADODB.Con nection")
    > DSNtest="DRIVER ={Microsoft Access Driver (*.mdb)}; "
    > DSNtest=dsntest & "DBQ=" & Server.MapPath( "../../cgi-bin/bicc.mdb")
    > Conn.Open DSNtest
    > %
    >
    > In combination with (a part of) the following codepage:
    >
    > %@LANGUAGE="JAV ASCRIPT" CODEPAGE="1252" %
    > !--#include file="Connectio ns/BICCwebsite.asp " --
    > %
    > var Recordset1 = Server.CreateOb ject("ADODB.Rec ordset")
    > Recordset1.Acti veConnection = DSNtest
    > Recordset1.Sour ce = "SELECT * FROM Nieuws ORDER BY Datum DESC"
    > Recordset1.Curs orType = 2
    > Recordset1.Curs orLocation = 2
    > Recordset1.Lock Type = 1
    > Recordset1.Open ()
    > var Recordset1_numR ows = 0
    > %
    > %
    > var Repeat1__numRow s = 4;
    > var Repeat1__index = 0;
    > Recordset1_numR ows += Repeat1__numRow s;
    > %
    > % var MM_paramName = ""; %
    > %
    > // *** Go To Record and Move To Record: create strings for maintaining
    > URL and Form parameters
    >
    > // create the list of parameters which should not be maintained
    > var MM_removeList = "&index=";
    > if (MM_paramName != "") MM_removeList += "&" +
    > MM_paramName.to LowerCase() + "=";
    > var MM_keepURL="",M M_keepForm="",M M_keepBoth="",M M_keepNone="";
    >
    > // add the URL parameters to the MM_keepURL string
    > for (var items=new Enumerator(Requ est.QueryString ); !items.atEnd();
    > items.moveNext( )) {
    > var nextItem = "&" + items.item().to LowerCase() + "=";
    > if (MM_removeList. indexOf(nextIte m) == -1) {
    > MM_keepURL += "&" + items.item() + "=" +
    > Server.URLencod e(Request.Query String(items.it em()));
    > }
    > }
    >
    > // add the Form variables to the MM_keepForm string
    > for (var items=new Enumerator(Requ est.Form); !items.atEnd();
    > items.moveNext( )) {
    > var nextItem = "&" + items.item().to LowerCase() + "=";
    > if (MM_removeList. indexOf(nextIte m) == -1) {
    > MM_keepForm += "&" + items.item() + "=" +
    > Server.URLencod e(Request.Form( items.item()));
    > }
    > }
    >
    > // create the Form + URL string and remove the intial '&' from each of
    > the strings
    > MM_keepBoth = MM_keepURL + MM_keepForm;
    > if (MM_keepBoth.le ngth 0) MM_keepBoth = MM_keepBoth.sub string(1);
    > if (MM_keepURL.len gth 0) MM_keepURL = MM_keepURL.subs tring(1);
    > if (MM_keepForm.le ngth 0) MM_keepForm = MM_keepForm.sub string(1);
    > %
    > !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    > SCRIPT RUNAT=SERVER LANGUAGE=VBSCRI PT
    > function DoDateTime(str, nNamedFormat, nLCID)
    > dim strRet
    > dim nOldLCID
    >
    > strRet = str
    > If (nLCID -1) Then
    > oldLCID = Session.LCID
    > End If
    >
    > On Error Resume Next
    >
    > If (nLCID -1) Then
    > Session.LCID = nLCID
    > End If
    >
    > If ((nLCID 0) Or (Session.LCID = nLCID)) Then
    > strRet = FormatDateTime( str, nNamedFormat)
    > End If
    >
    > If (nLCID -1) Then
    > Session.LCID = oldLCID
    > End If
    >
    > DoDateTime = strRet
    > End Function
    > /SCRIPT
    > html
    > head
    > title/title
    > meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
    > meta http-equiv="title" content="Aromas ys"
    > meta http-equiv="Content-Language" content="NL"
    > meta name="Author" content=""
    > meta name="Distribut ion" content="GLOBAL "
    > meta name="Revisit-After" content="14 days"
    > meta name="keywords" content="."
    > script language="JavaS cript" type="text/JavaScript"
    > !--
    > !--
    > function MM_preloadImage s() { //v3.0
    > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    > var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0;
    > ia.length; i++)
    > if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image;
    > d.MM_p[j++].src=a[i];}}
    > }
    >
    > function MM_findObj(n, d) { //v4.01
    > var p,i,x; if(!d) d=document;
    > if((p=n.indexOf ("?"))0&&parent .frames.length) {
    > d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
    > if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&id.for ms.length;i++)
    > x=d.forms[i][n];
    > for(i=0;!x&&d.l ayers&&id.layer s.length;i++)
    > x=MM_findObj(n, d.layers[i].document);
    > if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
    > }
    >
    > function MM_nbGroup(even t, grpName) { //v6.0
    > var i,img,nbArr,arg s=MM_nbGroup.ar guments;
    > if (event == "init" && args.length 2) {
    > if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
    > img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
    > if ((nbArr = document[grpName]) == null) nbArr =
    > document[grpName] = new Array();
    > nbArr[nbArr.length] = img;
    > for (i=4; i args.length-1; i+=2) if ((img = MM_findObj(args[i]))
    > != null) {
    > if (!img.MM_up) img.MM_up = img.src;
    > img.src = img.MM_dn = args[i+1];
    > nbArr[nbArr.length] = img;
    > } }
    > } else if (event == "over") {
    > document.MM_nbO ver = nbArr = new Array();
    > for (i=1; i args.length-1; i+=3) if ((img = MM_findObj(args[i]))
    > != null) {
    > if (!img.MM_up) img.MM_up = img.src;
    > img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?
    > args[i+1] : img.MM_up);
    > nbArr[nbArr.length] = img;
    > }
    > } else if (event == "out" ) {
    > for (i=0; i document.MM_nbO ver.length; i++) {
    > img = document.MM_nbO ver[i]; img.src = (img.MM_dn) ? img.MM_dn :
    > img.MM_up; }
    > } else if (event == "down") {
    > nbArr = document[grpName];
    > if (nbArr)
    > for (i=0; i nbArr.length; i++) { img=nbArr[i]; img.src =
    > img.MM_up; img.MM_dn = 0; }
    > document[grpName] = nbArr = new Array();
    > for (i=2; i args.length-1; i+=2) if ((img = MM_findObj(args[i]))
    > != null) {
    > if (!img.MM_up) img.MM_up = img.src;
    > img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
    > nbArr[nbArr.length] = img;
    > } }
    > }
    > //--
    > /script
    > link href="tekst.css " rel="stylesheet " type="text/css"
    > /head
    >
    >
    > I think I'm mixing up VBscript with Javascript but where?
    > Thanks in advance! A beginner...
    >
    >
    > --
    > sjanie[/color]


    Comment

    • Jeff Cochran

      #3
      Re: Frustrating problem with connection string

      On Tue, 19 Oct 2004 13:26:57 +0100, sjanie
      <sjanie.1eeozr@ news.webfrustra tion.com> wrote:

      This is VBScript format:
      [color=blue]
      >Set Conn = Server.CreateOb ject("ADODB.Con nection")[/color]

      This tells the page you don't use VBScript:
      [color=blue]
      >%@LANGUAGE="JA VASCRIPT" CODEPAGE="1252" %[/color]

      JavaScript would generate the error you posted since the syntax is
      incorrect. Set the language to VBScript if that's what you intend to
      use, either in IIS as the default or specified in your code.

      Jeff

      Comment

      Working...