Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can someone look at this database connection?

Posted on 2004-04-04
4
Medium Priority
?
367 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
  • 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Make the most of your online learning experience.
Simple Linear Regression
Six Sigma Control Plans

877 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