Solved

Can someone look at this database connection?

Posted on 2004-04-04
4
359 Views
Last Modified: 2011-09-20


adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="ctinter.mdb"


I have the data base in the same location. For some reason it is not working.
0
Comment
Question by:eteran
[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
4 Comments
 
LVL 6

Expert Comment

by:mirzas
ID: 10753028
it seems you have a problem with quotes...

http://www.connectionstrings.com/

0
 
LVL 8

Accepted Solution

by:
plq earned 250 total points
ID: 10753095
The path the ado will pick up might not be the same as your app.path

Its safer to specify the whole path

Also single quotes won't work

adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=""" & app.path & "\ctinter.mdb"""

I've never used that path, although I've seen it in articles

My favourite for access is :

adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & app.path &  "\ctinter.mdb;Jet OLEDB:System database=" & app.path & "\system.mdw"

That allows a system database too, if you dont need that it becomes

adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & app.path &  "\ctinter.mdb;"
0
 
LVL 2

Expert Comment

by:Ivan_Skrinjaric
ID: 10753134
I think it doesn't work because you dont have full path to ctinter.mdb and if it is web app then app.path won't work
Try this:

adoCon.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
           "Dbq=" & Server.MapPath(".") & "\ctinter.mdb;" & _
           "Uid=admin;" & _
           "Pwd="

I assume the MDB is in the same directory where the ASP page is running. Also make sure this directory has Write permissions for the user account.

Hope I helped.

Ivan
0
 
LVL 8

Expert Comment

by:plq
ID: 10753155
Yes now we've seen the other question its obviously asp not vb, but it wasn't obvious from this question hence my vb assumption.

Ah well
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A short article about a problem I had getting the GPS LocationListener working.
Introduction to Processes
Starting up a Project

705 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