Access data in MS-Access database using Javascript

You know that javascript is a client-side programming language. But if you want to use the local database like MS-Access in your HTML page just using javascript? Here is some code that help you access the data of MS-Access DB in HTML page using JavaScript:

Adding a Record

function AddRecord() {
var adoConn = new ActiveXObject("ADODB.Connection");
var adoRS = new ActiveXObject("ADODB.Recordset");

adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='/\dbName.mdb'");
adoRS.Open("Select * From tblName", adoConn, 1, 3);

adoRS.AddNew;
adoRS.Fields("FieldName").value = "Quentin";
adoRS.Update;

adoRS.Close();
adoConn.Close();
}

Removing a Record

function DeleteRecord() {
var adoConn = new ActiveXObject("ADODB.Connection");
var adoRS = new ActiveXObject("ADODB.Recordset");

adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='\\dbName.mdb'");
adoRS.Open("Select * From tblName Where FieldName = 'Quentin'", adoConn, 1, 3);
adoRS.Delete;
adoRS.Delete;

adoRS.Close();
adoConn.Close();
}

Editing a Record

function EditRecord() {
var adoConn = new ActiveXObject("ADODB.Connection");
var adoRS = new ActiveXObject("ADODB.Recordset");

adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='\\dbName.mdb'");
adoRS.Open("Select * From tblName Where FieldName = 'Quentin'", adoConn, 1, 3);

adoRS.Edit;
adoRS.Fields("FieldName").value = "New Name";
adoRS.Update;

adoRS.Close();
adoConn.Close();
}


Querying data:


var pad = "C:\\My Documents\\data.mdb";
var cn = new ActiveXObject("ADODB.Connection");
var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pad;
cn.Open(strConn);
var rs = new ActiveXObject("ADODB.Recordset");
var SQL = "SELECT * FROM datatable";
rs.Open(SQL, cn);
if(!rs.bof) {
rs.MoveFirst();
if(!rs.eof) {
document.write("<p>" + rs.fields(1).value + ", ");
document.write(rs.fields(2).value + ", ");
document.write(rs.fields(3).value + ".</p>");
}
}
else {
document.write("No data found");
};
rs.Close();
cn.Close();

How to Calculating the Perceived Brightness of a Color

When I'm searching on the Internet for the Image Processing Algorithm, I found this useful article, so I copy it to my blog. Thanks the Author of nbdtech.com.


I needed a way to test if a background color is light or dark in order to choose an appropriate text color (black on light colors and white on dark colors), you can find yourself in the same problem if you try to convert an image to grayscale.
I found many approaches that didn’t work well, I’ll describe them and the problems I discovered below – but first – the successful solution.
I finally found a solution that actually works on this web page the formula is:
brightness  =  sqrt( .241 R2 + .691 G2 + .068 B2 )
Or, in C# using the WPF's Color structure System.Windows.Media.Color (the same exact code should also work with the System.Drawing.Color structure used in WinForms and WebForms):
private static int Brightness(Color c)
{
   return (int)Math.Sqrt(
      c.R * c.R * .241 + 
      c.G * c.G * .691 + 
      c.B * c.B * .068);
}
This method will return a number in the rage of 0 (black) to 255 (White) and to set the foreground color based on the Brightness method:
Color textColor = Brightness(backgroundColor) < 130 ? Colors.White : Colors.Black;
I selected cutoff value of 130 by trial and error and it reflects my taste, every value in the rage 128-145 will give acceptable results.
Here is a table of all the named colors in .net 3.0, each with its name in readable text on it based on the code above, the number in parenthesis is the brightness – click on the image to view it in full size (in a new browser window).
Usually, when talking about color theory the range 0-1 is used for each component – so (0,0,0) is black, (1,1,1) is white and (0.5,0.5,0.5) is 50% gray, I’m not using this range, I’m using the 0-255 range used in most programming environments.

Why Not HSL or HSV?

You may think that the luminance (or lightness) component of the HSL color system or the value component of HSV will solve this problem, I did, but I was wrong.
The L component of the HSL and the V component of HSV describe the brightness of a color relative to a base color, if this base color is blue you will get a darker color than if this base color is yellow, HSL and HSV are very useful if you need to create a lighter or darker version of a color but aren’t very useful if you want to know how bright a color is.

The Naïve RGB Algorithm

If RGB 0,0,0 is black and RGB 255,255,255 is white then R+B+G should give us a good approximation of the color brightness, shouldn’t it?
The problem is that some colors are brighter than others, red is brighter then blue and green is brighter then red, maybe we just need to find the right coefficients for them?

The W3C Algorithm

The W3C working draft on accessibility has a formula for the perceived brightness of a color (based on the YIQ color system):
((Red value X 299) + (Green value X 587) + (Blue value X 114)) / 1000
This formula and references to it dominate the search results, probably because the W3C has high search engine rank.
This is better than using HSL, but it tends to give wrong results for many colors, especially shades of yellow.

RGB Color Difference

The W3C also has an algorithm to calculate the difference between colors:
(maximum (Red value 1, Red value 2) - minimum (Red value 1, Red value 2)) + (maximum (Green value 1, Green value 2) - minimum (Green value 1, Green value 2)) + (maximum (Blue value 1, Blue value 2) - minimum (Blue value 1, Blue value 2))
Or, in shorter form:
dR + dG + dB
Where dR, dG and dB are the difference in the Red, Green and Blue component.
If you calculate difference from white and difference from black – and compare them (if difference from black>difference from white then the color is dark) you actually get better results than using the brightness formula, but then you get wrong results for light greens and dark blues (probably because this formula doesn’t take into account the brightness difference of the colors).

3D Distance in RGB Space

You can think of the RGB color space as a cube where each of the 3 colors are axis, in one corner you have black (RGB 0,0,0) and in the opposite corner you have white RGB (255,255,255), so if a color is closer to black it should be darker.
The formula for 3D distance is:
Sqrt(dx2+dy2+dz2)
Where dx, dy and dz are the difference on the x, y and z axis.
This algorithm also gives mixed results because it doesn’t take into account the fact that some colors look brighter than others -  and that’s gets us back to …

Weighted Distance in 3D RGB Space (or the HSP algorithm)

If you scroll up to the beginning of this post and look at the brightness formula there you will see it’s just like the 3D distance formula except it gives different weight to each axis.
So now we finished our tour to color brightness land we have a good formula for calculating perceived brightness and (if my explanations where clear) we can actually understand why it works.

Source: nbdtech.com

Submit your site to Search Engines

Do you own a website/blog? Do you want to increase the visibility of your website/blog? Here is the tool for you to submit your websites/blogs to the popular search engines like Google, Yahoo, Bing,......
Just hover your mouse below, and enter your website/blog URL, then press Submit

A human life is shown in 3 minutes and 5 seconds





TOP 100 BEST FREE CLASSIFIED AD POSTING SITES

list od free ad posting sites
A recently updated and fresh list of top 10, top 50, and top 100+ best and free online ads posting classified ads websites around the internet world for the year 2012,mainly for the following countries- US, UK, Europe,India, Australia, China, Russia, Brazil, Germany, Canada, Italy, Japan-These are the biggest markets in the world for online free ad posting through classified sites. These free and paid ad posting websites listed here are very popular and famous among all ad posters who need to post free ads for their blogs or websites.Classifieds ads sites listed here are of high Google page rank ( PR 4-9) and high Alexa rank. And most importantly, these online ad posting free classifieds sites are listed according to their high Alexa ranking. Alexa  rankings and Google Page rankings are taken as the single most important factor while making this list of top 100 free ad posting classified websites or classified web directories. But there are some other factors as well that were kept in mind while making this list, such as-Usability,popularity,user-friendliness, and their searchability. 
In today’s time, online advertising has become very popular, beneficial and instant traffic generator for bloggers, online marketers, advertisers. Free ad posting on the popular classifieds sites has become one of the must have weapons for all types of online users who somehow need potential consumers to have a look at their showcased online products.
 
This list of top 100 free online ad posting sites is divided into segments to break the list into "top 10 free ad posting sites", "top 50 free ad posting sites" and " top 100 free ad posting sites"s. In this way you will get to know which ad posting site should be given how much priority and which one stands where.On many of these websites you can directly post free ads without any sign up or registration required, while some ask for a sign up or registration to post free ads. If you need to post free ads on daily basis, then you should open a free account on these free ad posting sites.

 
This best list of top 100 free ad posting websites for bloggers and ad posters is mainly popular in the countries including, US, UK,India,Australia, Asia,Europe, UAE, Germany,France, Italy, Japan,China, Pakistan, etc. 
The top 100 free ad posting list mostly contains name of those free-classified ad sites that are very popular and largely traffic driven, and they provide good resource for the best free ad posting options and features.


You can also find my similar blog post for list of top 100+ free Indian Classified ads posting sites 


This fresh list of best free ad posting sites, free classified sites or free ad-posting web sites contains free ad posting sites that can be categorized further according to their region, types of users, types of accounts, HTML formatting options, and products range being advertized on them. Around  60% of these free ad posting sites have global appeal/users !


Account Based Types of Ad Posting Websites  -

  1. Free Ad Posting Classifieds Sites.
  2. Paid Ad Posting Sites.
  3. Sign Up Or Registration Required For Ad Posting-You need to open an account.
  4. No Sign Up Or Registration Required-You can instantly start posting your ads.  
Region Based Types of Ad Posting Websites-
  1. Local advertising sites or neighborhood classifieds websites- City wise.ad posting.
  2. Country level advertising ad posting sites-your ad viewed through out the nation.
  3. Global Ad posting sites- Your ad is viewed globally, around the world.
Why to post on Free Classifieds sites-


There are lots of benefits and unavoidable reasons to why you should post ads on these classifieds sites-
  1. First thing first, post ads to sell any physical, online product ( through affiliate marketing or simply selling consumer products).
  2. To grab the instant traffic. Ad posting can bring a huge free traffic to your site/blog/forum/lens.
  3. You can create your own mailing list for online marketing ( through the response your ads receive)
  4. You build links. By posting your links on these highly Alexa ranked classifieds ad posting sites you can create strong back links to your website/blog.  

Visit 20 Ad posting sites for posting free ads without registration and sign up needed



Top 10 Best Online Ad Posting Sites List





Top 10 Free Ad posting Sites Post Free Ads Classifieds Ad Sites Description: what to post for. Popularity Region/Country
1 Craigslist craigslist.org craigslist provides local classifieds and forums for jobs, housing, for sale, personals, services, local community, and events. Global Appeal.
Classifieds according to Countries and cities.
You can post free ads on Craigslist any where worldwide!
2 Quikr Quikr.com Quikr Classifieds Post Free Classified Ads online, Search Free Classifieds Ads for Mobiles, Cars, Jobs, Apartments, Pets, Courses, Laptops, Computers, Travel ... Local + Global presence.
Mainly its an indian classified site. But this also has an option for “International” ad posting.Very High Alexa ranking.Quikr is free and very effective.
3 Gumtree Gumtree.com Free Classifieds in United Kingdom - Join United Kingdom's online community - free classifieds, jobs, property, cars, flatshare and more free classifieds in .. Local + Global.
Gumtree is mainly popular in London, though it has a wide range of users across many European, UK and Asian Countries !
4 ClickIndia ClickIndia.com Click India Classifieds - A Site To Post Free Buy Sell Indian Classified Ads Online. Search Classified Ads For Jobs, Find Real Estate Properties On Sale, Sell ... Local +Global.
ClickIndia is one of the most popular free ad posting classifieds sites in India.But this also has an option for “International” ad posting.
5 Olx OLX.com Free Local OLX Classifieds. Search and post classified ads in For Sale, Cars, Jobs, Apartments, Housing, Pets, Personals, and other categories. Global.
You can easily post free ads through OLX. Very easy and effective ad posting site. very good Goole page rank and high Alexa rank. 
6 eBayclassifieds ebayclassifieds Use free eBay Classifieds (Kijiji) to buy & sell locally all over the United States. Only Local Ads Near You! consumer, digital products buy, sell. Local
ebayclassifieds is mainly popular in US. Its ideal for local neighborhood ads, Buy-sell ads.  personal ads, pets ads, and all the types of household items items.
7 Adsglobe adsglobe.com Post free ads or online classifieds in jobs, real estate, rentals, autos, items for sale ads... Most effective online classifieds advertising for consumers and ... Global
Adsglobe is a very popular free classifieds site with lots of categories available to you for ad posting.
Adsglobe has a goog Google page rank and high Alexa rank.
8 Oodle Oodle.com Post free ads and search millions of free classifieds ads for used cars,jobs, apartments, real estate, pets, tickets and more. Global.
Oodle is purely a genius and brilliant popular classifieds site since it post your ads on many social networking sites. Unique ad posting site this way!
9 Sell sell.com Sell.com Marketplace, merchant advertising and e-commerce solutions. Buy sell trade: pets, autos, homes, computers, and fashion for sale by owner.ecommerce. solutions. Global.
Sell.com is a very popular and huge marketplace for online advertisement of many types including, buy, sell,merchant advertisement,
10 Classifiedads classifiedads Free classified ads for cars, jobs, real estate, and everything else. Find what you are looking for or create your own ad for free! Global.
Classifiedads.com is a very famous, popular and big market place for online ad posting, advertising of many types.

Top 50 FREE Best Online Ad Posting Sites List(10-50)




Top 50 Online Free Ad Posting Sites List. Top 50 Online Free Ad Posting Sites List.
11 Click.in 31 Ivarta
12 Indialist 32 Digitalbhoomi
13 Locanto 33 ocala4sale.com
14 globalFreeClassifiedAds 34 bonqo.com
15 classifiedslive 35 traderonline.com
16 Rediff 36 claz.org
17 Bechna 37 Goforads
18 Khojle 38 Meramaal
19 Adpost 39 Indnav
20 Ddoos 40 Classifiedsden
21 Vivastreet 41 Zopdy
22 Webindia123 42 adlandpro.com
23 inetgiant.com 43 Thisismyindia
24 vast.com 44 Sulekha
25 yakaz.com 45 Ibibo
26 pennysaverusa.com 46 Indiagrid
27 daype.com 47 salespider
28 ziply.com 48 Sify
29 Adeex 49 domesticsale.com
30 Whereincity 50 Adsmantra

Top 100 free best classifieds sites list(51-100)


Top 100 Online Free Ad Posting Sites List. Top 100 Online Free Ad Posting Sites List.
51 epage.com 52 .freeadscity.com
53 recycler.com 54 chooseyouritem
55 webcosmo.com 56 Rajb2b
57 hoobly.com 58 Indyapulse
59 freeadlists.com 60 Bupio
61 bestwayclassifieds 62 wantedwants.com
63 webclassifieds.us 64 Dragg
65 Classifieds4me 66 E-classifieds.net
67 Boostim 68 buysellcommunity.com
69 Classifieds.co.uk 70 businesslist
71 Askht 72 Google.com/base
73 Classifieds.yahoo.com 74 Kaboo.com
75 Bizmartindia 76 Bharatpatal
77 Postyouradforfree.com 78 Highlandclassifieds
79 Loyalmart 80 Mid-day
81 Bestadforum.com 82 Kijiji.com
83 Citynews.com 84 Livedeal.com
85 Selloutads.com 86 Ozfreeonline.com
87 Worldslist.com 88 Kugli
89 Subblurbs.com 90 Droik
91 Kaboo.org 92 Isell.com
93 Iclads.com 94 Itsmymarket.com
95 Postaroo.com 96 Marketplace.sfgate.com
97 London.kijiji.ca 98 Freeads.biztop.com
99 Freeadvertisingzone 100 Economist.com/classifieds
101 Freeadvertisingexchang 102 Ablewise
103 Friday-ad 104 Localgrunts
105 Adquest3d 106 Caklassifieds
107 Davisstraub 108 Classifieds.co.uk
109 Classifiedscrossing 110 Expo.live.com

I have taken a lot of care while publishing this “Top 100 list of best free ad posting classifieds sites “. Still, i accept that this list needs the constant feedbacks and updates to keep it updated/fresh and relevant to its present content. Please do post a comment, if you have noticed anything like an issue, error,link-breaks, disconnects, or anything relevant to this post. Thanks !



Source: topbestlisted

Sponsors