Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

How to connect to MS Access Database Using ASP

This tutorial documents code for connecting to a MS Access Database using the DSN-Less approach. With DNS-Less approach all you have to do in your code is define the location where your database resides.

On Monday, January 24th 2005 at 09:00 AM
By Nabeel Akhtar (View Profile)
****-   (Rated 3.3 with 25 votes)
Contextual Ads
More ASP Resources
Advertisement
This tutorial will show you how to connect to a MS Access database using the DSN-less approach.
Remember, your database can reside anywhere in your computer. If you are not sharing your database it is advisable not to keep your database under the "wwwroot" directory.

Assumptions:

Database is password protected

Running IIS



Just copy and paste the following code in your ASP file and read the comments to modify settings according to your needs: (Text in grey are comments)







<%

'Start the ASP Tag

Set conn = server.createobject("adodb.connection")



'Define the location of your database and your Password

conn.connectionstring = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\dir\database.mdb;pwd=Your_Password"



'Open Connection

conn.Open





Set rs=Server.CreateObject("ADODB.recordset")



'Enter your SELECT Statement

rs.open "Select col1,col2 from table_name", conn

do until rs.EOF



'Output to browser

response.write ("Col1 and Col2 Values" & rs("col1") & rs("col2") &"<BR>")



'Move to the Next Record in the database

rs.movenext

loop

rs.close



'Close connection

conn.close

%>


To contact the author please click here



More Tutorials from this author can be found at http://www.nabeelakhtar.net
Digg Digg It!     Del.icio.us Del.icio.us     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this tutorial
Comment Current Comments
by Administrator on Wednesday, November 9th 2005 at 01:31 AM

<i>Comment deleted due to abuse</i>.

by ahmed ali on Friday, February 3rd 2006 at 01:43 AM

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

I need help on this error
why it occurs
what can i do to remove this error from my page
Waiting for your consideration
Regards

by <tr> on Wednesday, February 14th 2007 at 09:01 AM

qwqwwwwwwwwwww

by Salman on Monday, April 9th 2007 at 05:44 AM

What if i have to use microsoft jet drivers.

by Michael Hall on Tuesday, April 24th 2007 at 12:19 PM

Thanks for the code, i have more experience with asp.net and sql connection but i just wanted to write a simple site with html pages and a asp page to send comments to an access database.

This works just fine, Thanks again

Mike

by Arie on Monday, May 28th 2007 at 03:49 AM

Great, i like IT!!!

by Radhika on Wednesday, June 13th 2007 at 10:30 AM

Hi,

I am currently using \\\'EDitPlus\\\' to code my html. I need to access my MS Access database from it. I have never used MS Access before this. Though i have understood how to create tables, data entries and queries with Access, i still have not figured out how to access any of it from my HTML, coded on EditPlus.

Could you help me with this please!

Thanks! I appreciate any help in this matter.

Radhika.

by BELLO DAUDA on Wednesday, June 27th 2007 at 05:20 AM

i find your site very interesting but please include coding in the next update of access tutorials
thanks

by chandrakant on Monday, September 10th 2007 at 11:19 AM

hi everybody ;
NEED A LITTLE HELP
I WANT A SCRIPT/CODE FOR THE DOWNLOAD OPTION (eg. IF I CLICK THE ..........ZIP OR A EXE FILE IT MUST START TO DOWNLOAD FROM THE SOURCE PROVIDED )

SO PLS!ANY ONE HELP ME HELP ME PLS!!!!!!!!!!!!!!1



THANKYOU

by Aditya on Tuesday, September 18th 2007 at 10:50 AM

Hi All,

i want to fetch the value from the db and that values show in txt field through asp.

Thanks.

by ashok on Monday, October 1st 2007 at 06:43 AM

this is a easy method to beginers

by rohit on Tuesday, November 13th 2007 at 05:49 AM

test test test

by suresh on Wednesday, November 21st 2007 at 05:03 AM

HI i want to connect the MS Access Database through ASP.Net...
PLz provide some instructions...

by Amit on Wednesday, January 23rd 2008 at 07:48 AM

How to connect MS Access Database through Visual Basic..???
Plzz help me...!!! Its very urgent...

by andre on Monday, February 4th 2008 at 08:38 PM

HI all..
I try to insert database access using ASP
i need help on error.
this is syntax i writen

<%
set conn = server.createobject(\"adodb.connection\")
DSNtemp=\"DRIVER={Microsoft Access Driver (*.mdb)}; \"
DSNtemp=dsntemp & \"DBQ=\" & server.mappath(\"Friends.mdb\")
conn.Open DSNtemp

SQLstmt = \"INSERT INTO Friends (Name,Link)\"
SQLstmt = SQLstmt & \" VALUES (\'agus\',\'hthtp\')\"
conn.execute(SQLstmt)

%>

and the error is:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key \'Temporary (volatile) Jet DSN for process 0x8f4 Thread 0xc00 DBC 0x13b7024 Jet\'.
/sample/sample2.asp, line 7

i\'m not not understand what it mean.
if anyone have example to insert/update/delete data in Access using ASP. I need that. thanx.

Andre

by Jeba on Monday, March 24th 2008 at 03:17 AM

Hi all!!
Im geting the error mentioned below if i try to write some data to the browser from the MS Access DB. Can anybody help me out!!
Its urgent! :( :(

Technical Information (for support personnel)

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xfc0 Thread 0xb04 DBC 0x11f3ffc Jet'.
/new.asp, line 17

by Bhushan on Wednesday, July 9th 2008 at 11:04 AM

Hi ,

I am unable to insert the data into MS Access 2000 DB using ASP, there are no syntax errors. Please can some look into it.


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/activity/activity_entry.asp, line 49

Regards,

by sonia chopra on Saturday, February 21st 2009 at 06:24 AM

how can i change my profile in the database using ASP code

by sonia chopra on Saturday, February 21st 2009 at 06:24 AM

how can i change my profile in the database using ASP code

by sonia chopra on Saturday, February 21st 2009 at 06:25 AM

how can i change my profile in the database using ASP code

by sonia chopra on Saturday, February 21st 2009 at 06:25 AM

how can i change my profile in the database using ASP code

by deepak on Saturday, April 4th 2009 at 02:58 PM

hi,
I m unable to insert data into access table....
please see the error n hlp me to remov it.....
by thnks.....


Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/insert.asp, line 13

by alina on Saturday, April 25th 2009 at 12:43 AM

you can get more details from www.ysapak.com www.fysisoft.com and www.apnyfriends.com

by mrudula on Wednesday, November 25th 2009 at 09:58 PM

give me details explanation for examples..give more examples on data base connection along with clear output

by mrudula on Wednesday, November 25th 2009 at 09:59 PM

give me details explanation for examples..give more examples on data base connection along with clear output

by Kim Phally on Sunday, December 6th 2009 at 09:04 PM

Video how to connect database in asp.net

by Kim Phally on Sunday, December 6th 2009 at 09:04 PM

Video how to connect database in asp.net

by ushanandhini on Wednesday, December 30th 2009 at 05:03 AM

pls tell how create the loginform for visualwebgui

by ushanandhini on Wednesday, December 30th 2009 at 05:03 AM

pls tell how create the loginform for visualwebgui

by ushanandhini on Wednesday, December 30th 2009 at 05:03 AM

pls tell how create the loginform for visualwebgui

by indrani on Wednesday, January 13th 2010 at 04:58 AM

Hi..
Pls tell me how to connect c with MS access ...

Iam struggling to get that..

Ur help is very needful and helpful for me ..

Pls

by magesh on Sunday, July 4th 2010 at 06:34 AM

i got error wit tis code help me....
to connect with Ms access

by JUDYPACHECO20 on Friday, July 16th 2010 at 09:18 AM

Don't have enough money to buy some real estate? You not have to worry, because it is possible to take the <a href="http://bestfinance-blog.com/topics/home-loans">home loans</a> to solve such kind of problems. So take a college loan to buy everything you want.

by Konsolen on Tuesday, August 31st 2010 at 03:44 AM

Vielen Dank! Super Artikel! Wenn Sie Elektronik möchten,Können Sie im unser efox-shop suchen.wir bieten Navigation ,GPS Gerät ,DVD Spieler ,Auto Werkzeuge ,Auto Schmuck ,Kfz Zubehör AND China GPS , Navigation Gerät AND Auto DVD Spieler kaufen , Auto GPS Gerät kaufen AND Auto Rückfahrsystem Konsolen usw.
welcome you to : http://www.efox-shop.com/pc-videospiele-china-spiel-konsole-c-236_395.html Die besten Dual SIM Handys, <a href=" www.efox-shop.com/pc-videospiele-china-spiel-konsole-c-236_395.html "> Konsolen </a.>,

by Konsolen on Tuesday, August 31st 2010 at 03:44 AM

Vielen Dank! Super Artikel! Wenn Sie Elektronik möchten,Können Sie im unser efox-shop suchen.wir bieten Navigation ,GPS Gerät ,DVD Spieler ,Auto Werkzeuge ,Auto Schmuck ,Kfz Zubehör AND China GPS , Navigation Gerät AND Auto DVD Spieler kaufen , Auto GPS Gerät kaufen AND Auto Rückfahrsystem Konsolen usw.
welcome you to : http://www.efox-shop.com/pc-videospiele-china-spiel-konsole-c-236_395.html Die besten Dual SIM Handys, <a href=" www.efox-shop.com/pc-videospiele-china-spiel-konsole-c-236_395.html "> Konsolen </a.>,

by Konsolen on Tuesday, August 31st 2010 at 03:45 AM

Vielen Dank! Super Artikel! Wenn Sie Elektronik möchten,Können Sie im unser efox-shop suchen.wir bieten Navigation ,GPS Gerät ,DVD Spieler ,Auto Werkzeuge ,Auto Schmuck ,Kfz Zubehör AND China GPS , Navigation Gerät AND Auto DVD Spieler kaufen , Auto GPS Gerät kaufen AND Auto Rückfahrsystem Konsolen usw.
welcome you to : http://www.efox-shop.com/pc-videospiele-china-spiel-konsole-c-236_395.html Die besten Dual SIM Handys, <a href=" www.efox-shop.com/pc-videospiele-china-spiel-konsole-c-236_395.html "> Konsolen </a.>,

by Konsolen on Tuesday, August 31st 2010 at 03:45 AM

Vielen Dank! Super Artikel! Wenn Sie Elektronik möchten,Können Sie im unser efox-shop suchen.wir bieten Navigation ,GPS Gerät ,DVD Spieler ,Auto Werkzeuge ,Auto Schmuck ,Kfz Zubehör AND China GPS , Navigation Gerät AND Auto DVD Spieler kaufen , Auto GPS Gerät kaufen AND Auto Rückfahrsystem Konsolen usw.
welcome you to : http://www.efox-shop.com/pc-videospiele-china-spiel-konsole-c-236_395.html Die besten Dual SIM Handys, <a href=" www.efox-shop.com/pc-videospiele-china-spiel-konsole-c-236_395.html "> Konsolen </a.>,


Comment Comment on this tutorial
Name: Email:
Message:
Comment Related Tutorials
There are no related tutorials.

Comment Related Source Code
There is no related source code.

Jobs ASP Job Search
My skills include:
Enter a City:

Select a State:


Advanced Search >>
Sponsors
Discover Geekpedia

Other Resources