Connectivity with Access database using JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aniket kalvit
    New Member
    • Feb 2012
    • 1

    Connectivity with Access database using JavaScript

    Can we do the connectivity in javascript with access?
    If yes tell me the process please please !!!!!
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    there might be some possibility with ActiveX in IE, though that is rather JScript than JavaScript.

    Comment

    • JackieBolinsky
      New Member
      • Feb 2012
      • 6

      #3
      Hello Aniket, this may be helpful.

      Code:
      function GetValue(strDate,Value)
      {
      var strReturnValue = null;
      var axoConnection = new ActiveXObject("ADODB.Connection");
      var strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/Inetpub/wwwroot/test;Extended Properties = FoxPro 3.0;";
      var axoRecordSet = new ActiveXObject("ADODB.Recordset");
      var SQL = "SELECT " + Value +" FROM PW030 WHERE L_PNR='" + g_PersonalNumber + "' AND L_DATUM=" + strDate;
      
      axoConnection.Open(strConnection);
      axoRecordSet.Open(SQL, axoConnection);
      
      axoRecordSet.Close();
      axoConnection.Close();
      
      return strReturnValue;
      }
      the suggestion is to not use javascript, and instead use a server side technology such as ajax, asp, or php. The reason being that those technologies are server side, so the SQL Server can be housed such that it is not accessible to the outside world and so that the backend technologies being used are not apparent to the client. If you use javascript, the client gains access to the server directly. If they know their user/password information they can log in directly and perform update/delete/select queries directly.

      Regards,
      Jackie
      Last edited by Niheel; Feb 9 '12, 06:41 AM. Reason: Please use [CODE] [/CODE] tags when posting code. Please don't use SEO link tricks.

      Comment

      Working...