By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,518 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

Connectivity with Access database using JavaScript

P: 1
Can we do the connectivity in javascript with access?
If yes tell me the process please please !!!!!
Feb 8 '12 #1
Share this Question
Share on Google+
2 Replies


Dormilich
Expert Mod 5K+
P: 8,639
there might be some possibility with ActiveX in IE, though that is rather JScript than JavaScript.
Feb 8 '12 #2

P: 6
Hello Aniket, this may be helpful.

Expand|Select|Wrap|Line Numbers
  1. function GetValue(strDate,Value)
  2. {
  3. var strReturnValue = null;
  4. var axoConnection = new ActiveXObject("ADODB.Connection");
  5. var strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/Inetpub/wwwroot/test;Extended Properties = FoxPro 3.0;";
  6. var axoRecordSet = new ActiveXObject("ADODB.Recordset");
  7. var SQL = "SELECT " + Value +" FROM PW030 WHERE L_PNR='" + g_PersonalNumber + "' AND L_DATUM=" + strDate;
  8.  
  9. axoConnection.Open(strConnection);
  10. axoRecordSet.Open(SQL, axoConnection);
  11.  
  12. axoRecordSet.Close();
  13. axoConnection.Close();
  14.  
  15. return strReturnValue;
  16. }
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
Feb 9 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.