[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Cannot conect to Access 2007 using ASP

Posted on 2008-06-26
2
Medium Priority
?
444 Views
Last Modified: 2012-06-21
Hi I am having some problems connecting to my Access 2007 database.
Can anyone help?
Thanks
<%
	Set objConn = Server.CreateObject("ADODB.Connection")
	ConnStr = "DRIVER={Microsoft Access Driver (*.mdb,*.accdb)}; "
	ConnStr = ConnStr & "DBQ=" & Server.MapPath("database\db.accdb")
	Response.Write(ConnStr)
	objConn.Open(ConnStr)
	
	Set objRS = objConn.Execute("SELECT * FROM table1")
	
	While not objRS.EOF
		Response.Write(objRS("name"))
		objRS.movenext
	Wend
	
	objRS.Close
	Set objRS = Nothing
	objConn.Close
	Set objConn = Nothing
%>

Open in new window

0
Comment
Question by:ricteo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Expert Comment

by:Dauhee
ID: 21878099
and what is your problem?

should the file extension be .mdb
0
 
LVL 2

Accepted Solution

by:
jweissdandm earned 225 total points
ID: 21891470
what about this
<%
dataSource = "D:\path_to_database.mdb"	
 
 
set Myconn = Server.CreateObject("ADODB.Connection")
MyConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&dataSource&""
MyConn.Open MyConnString
 
'grab data and add it to an array
set rs = MyConn.execute ("SELECT * from myTable")
array1 = rs.getRows()
rs.close
set rs = nothing
 
%>

Open in new window

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question