Connection String -- What am I doing wrong? - InfoPath Dev
in

InfoPath Dev

Connection String -- What am I doing wrong?

Last post 05-20-2007 02:20 AM by chang. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-14-2007 10:27 AM

    Connection String -- What am I doing wrong?

    I'm trying to learn jscript so that I can program my infopath forms and I'm having a hard time connecting to my database.  My database is stored on a shared drive.  Does it have to be on my local machine?  Heres my code:

     function CTRL30_32::OnClick(eventObj)

    {

    var pobjConnection = new ActiveXObject("ADODB.Connection");  

    pobjConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=J:\Dudley\Projects.mdb;User Id=admin;Password=;")

    var pstrSQL = "SELECT * FROM Projects";   

    var pobjRS = pobjConnection.Execute(pstrSQL);

    }

     I know this doesn't do anything yet but every time I try to run it I get an error that it cannot find the file "J:\DudleyProjects.mdb"  It refuses to recognize the second slash mark in my data source.  Can someone please tell me what I'm doing wrong and/or how to fix it?  Thanks!!

  • 05-20-2007 02:20 AM In reply to

    • chang
    • Not Ranked
    • Joined on 03-28-2007
    • Posts 23

    Re: Connection String -- What am I doing wrong?

    Try escaping the backslashes like in:

    J:\\Dudley\\Projects.mdb

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.