Can someone look at this database connection?

Posted on 2004-04-04
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.
Question by:eteran
  • 2

Expert Comment

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


Accepted Solution

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;"

Expert Comment

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;" & _

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.


Expert Comment

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
thread-safe code in c++ 2 72
scores100 challenge 3 84
bunnyEars challenge 6 67
countX 22 70
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now