Solved

Can someone look at this database connection?

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java  and programming certification ? 4 94
numbers ascending pyramid 101 195
Turning python script into an applet 12 111
sp_configure 'external scripts enabled', 1; 7 51
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This is an explanation of a simple data model to help parse a JSON feed
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

773 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