2008年12月13日星期六

asp如何连接ACESS数据库方法----asp链接数据库-----asp代码

源码摘自淘一宝手机数码网站

写程序,当然要用到数据库,在编程这个行业中80%写的程序都会用的数据库,用网站来说,对于中小网站用的数据库类型最多的是ACCESS类型数据库,做网站的编程语言在中国最普遍的是asp语言,因为他简单易学,十天只能基本上可以做好一个网站,功能俱全,写网站当然第一步就是如何连接数据库了,下面是介绍asp如何连接ACCESS数据库的方法
第一、建好ACCESS数据库。
第二、用dw建立一个asp程序的页面
第三、写asp连接ACCESS数据库的代码,代码如下。

set conn=server.createobject("ADODB.CONNECTION")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath(dbname)
第四、然后保存在同一个目录下面。
第五、启动iis运行网站。

就拿一个已经做好的网站来说吧,淘一宝手机数码,该网站后台数据库就是ACCESS数据库类型,其中源码也是摘自淘一宝网站

源码摘自淘一宝手机数码网站

没有评论:

wholesale retail company from china

achinaseller.com is a professional wholesale retail company, having our own factory with 5 years of wholesale retail experience. Achinaseller.com is also cooperating closely with many factories, so the price that we offer to the consumer is directly from the Chinese Factory. Without leaving your home, you could order your own products at achinaseller.com at the lowest price.
We service over 100,000 registered buyers, delivering to virtually every country in the world. Our warehouse and office are staffed by a young team of Chinese and Western staff.
Happy AchinaSeller buyers include frequent wholesale importers, famous ecommerce websites, eBay powersellers, retail shops and startup home import businesses. On a daily basis, we serve corporate buyers, drop-ship experts, home business Moms, and small bussiness wholesaler