Solved

Can someone look at this database connection?

Posted on 2004-04-04
4
358 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

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

Suggested Solutions

Title # Comments Views Activity
Difference between List and Array in Python 5 140
IDE for Python 5 104
Documenting and diagramming code flow within a VBA Excel project 5 79
Convert number to hex in Lua 16 81
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

739 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