Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

Help needed connecting to a MS Access DB via ADO


I am using Delphi 6 and connecting to an MS Access 2003 database file.

I basically have written an install program which installs the needed files (so I think ???) to run the application - the database mdb file, the Application exe, an ini file and the following qtintf.dll ??.

The install works and the application runs on my pc (which it should), but when I go to install it on another pc, and then run it - a login dialog appears asking for an admin password.

I have checked other questions and answers within EE, and have set login prompt to False, User ID ="", set the database password etc...., but still cannot get the application to run. It appears to only happen on pc's that do not have MS ACCESS installed ?

I thought that Windows XP SP2 should have relevant drivers - MDAC etc.. required.

I am wanting to Secure the MS Access database file so that it cannot be copied and open via MS Access, and only opened via my Application via my login dialog.

Any urgent help would be greatly appreciated.

  • 7
  • 4
  • 3
  • +1
3 Solutions
pjeliasAuthor Commented:
I have now tried absolutely everything I can find, but still have no luck.

The Application will load the database and run OK on my pc, but keeps asking for the login prompt on a pc that does not have MS Office / Access installed.

Sounds like a file is missing but which one ?
Post your connection string to see if you wrote it correctly. This works for me in my applications that use password protected mbd files (of course the login prompt set to false). you see that i don't put the user id in the connection string

sCon:='Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=somepassword;Data Source='+Filename+';Persist Security Info=False';

Also if you still get the login try to use the user id set to admin.

sCon:='Provider=Microsoft.Jet.OLEDB.4.0;Uid=Admin;Jet OLEDB:Database Password=somepassword;Data Source='+Filename+';Persist Security Info=False';
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

You cannot protect your mdb from being opened by ACCESS this way. There are Access password crackers on the net... just look them up on google
In order to achieve that you would have to consider building an encryption/decryption algorithm that would decrypt your mdb somewhere hidden every time your program opens it, and re-encrypt it when your app closes.
This is also crackable since there will be an un-encrypted file on your users harddrive while the app is running. But if you decide to give it a name that would not raise suspicions, maybe give up on the mdb extension, place your db file somewhere in windows/system32 or stuff like that.

Also setting a password on the mdb is very risky for the case your mdb file gets corrupted... and the tool that could help you recover data will not work because the password that is needed to "open" the database also gets corupted... Trust me on this, I had this situation a couple of times.

As for your problem... does it come up when you try to install the application or when you try to run it?
- XP SP2 has the MDAC 2.8 I think installed automatically (you can't get rid of it even if you would want to), so the problem to connect to your mdb using ADO is solved
- your password is requested by the database connection? or is it requested by your application (>"via my login dialog"<)? Or is it requested by windows when you try to install the app?
 There are multiple posibilities, so please be more specific.


pjeliasAuthor Commented:
The application installs OK, it is when I go to run the application that an ACCESS dialog or ADO dialog appears asking for the Username and Password - this is not my login dialog.

This appears before my login dialog. I have tried all user id and password combinations, but the dialog keeps appearing, as if the password is not successful until an error occurs.
pjeliasAuthor Commented:
Tried the MDBSecure above - would not let me open the DB file without using MDBSecure ???

I even tried without a password on the database and that would not work either, also get a login prompt asking for a user id and password.

It appears that it just does not want to open unless MS Office / Access is installed.

How can I tell what files are needed/missing ?


Did you tried to use the connections strings that i've posted above?
Wim ten BrinkSelf-employed developerCommented:
> I am wanting to Secure the MS Access database file so that it cannot be copied and open via MS Access, and only opened via my Application via my login dialog.

With Access? Impossible... :-)
If you want to make it harder for the user to access the data in your database then I'd suggest you use some other type of database. There are quite a few alternatives.

Also check out about that QTINTF.DLL library. Apparantly you're using a CLX unit in your code somewhere. Really annoying buggers, those libraries. Originally created for compatibility with Kylix but in the end about as useless as CALC.EXE... :-) (Well, useless if you have a real calculator next to your computer anyways...)
The login box you get is because your connection string.
So change / rebuild it and it will be ok.
Ok meaning that you wont get the login box again.
Use a ADO Connection component and set it's login promt to false, and then use it's connectionstring Builder.
It's piece of cake
pjeliasAuthor Commented:
I have used the connection string builder, the login prompt is set to false and below is my connection string + code to open the database

I have also tried multiple variations to the string below - same results

cString is a String Variable
dbSource is the path location of the database obtained from an ini file

  cString:=cString+'User ID=Admin;';
  cString:=cString+'Data Source='+dbSource+'\dbMaster.mdb;';
  cString:=cString+'Mode=Share Deny None;Extended Properties="";';
  cString:=cString+'Persist Security Info=True;';
  cString:=cString+'Jet OLEDB:System database="";';
  cString:=cString+'Jet OLEDB:Registry Path="";';
  cString:=cString+'Jet OLEDB:Database Password="";';
  cString:=cString+'Jet OLEDB:Engine Type=5;';
  cString:=cString+'Jet OLEDB:Database Locking Mode=1;';
  cString:=cString+'Jet OLEDB:Global Partial Bulk Ops=2;';
  cString:=cString+'Jet OLEDB:Global Bulk Transactions=1;';
  cString:=cString+'Jet OLEDB:New Database Password="";';
  cString:=cString+'Jet OLEDB:Create System Database=False;';
  cString:=cString+'Jet OLEDB:Encrypt Database=False;';
  cString:=cString+'Jet OLEDB:Don''t Copy Locale on Compact=False;';
  cString:=cString+'Jet OLEDB:Compact Without Replica Repair=False;';
  cString:=cString+'Jet OLEDB:SFP=False';


Also, I think I found the CLX Unit - Qt - don't know why it was included in some of my files or how it got there, I remarked all occurrences, so this should no longer exist (I hope)

ps. don't knock CALC.EXE - great tool for those of us who don't seem to have a calculator that works around when we need one.
pjeliasAuthor Commented:

appears your answer did the job - appears the most basic Connection String seemed to work.

I had your Values in, but had them included with other properties within my string.

Must be one of the other properties that caused the problem ?????

Also, Alex, I removed all references I could find for CLX units, and rebuilt the application as well as removed all qtintf*.dll files, yet when I install it on another pc and go to run the application, a msg appears saying that it could not find qtintf.dll ????

I searched for all of the following CLX units , but only found references to Qt, which I removed.


yes the  Uid and Persist Security Info set to False
pjeliasAuthor Commented:
Seems I was a bit premature in my awarding of points.

If I run the application by just manually copying the files to the other pc, with the qtintf.dll in the same directory as the EXE, the application works.

If I install the application via my installation process, with the qtintf.dll in the windows\system32 directory - the application comes up with the same error.

Ideally according to Alex (and Borland????), I should not be using qtintf.dll, but am unable to get rid of it ?????
pjeliasAuthor Commented:
The application now appears to work - I updated my install program with updated files, HOWEVER, my application still requires qtintf.dll.

How do I get rid of this ?
(should possibly be another question, however since Alex raised the question .........????. )
Wim ten BrinkSelf-employed developerCommented:
Unfortunately I'm at my work right now and can only answer during some short breaks. The need for that qtintf.dll means your application is still using a sourcefile that uses the QT library. (It's QT.pas that loads this library.) To find out which one, you will have to check ALL sourcefiles that you use and check their dependencies. It's a lot of work but there are solutions for this that might make it easier... is a Delphi IDE expert and it has an option 'Project Dependencies' which will find all unit dependencies of your project. If you use it, export the whole list to a CVS file, open the file in Notepad and search for the QT unit then you probably find the link between this unit and some other units that sstill (secretly) uses this QT unit.

As an alternative, you can buy the Pascal Analyzer or use the Free Icarus analyzer from and let it analyse your project. Icarus is all you need for now since all you need to know are the unit relations.

However, the only solution to getting rid of this DLL is by going through your whole project, finding the path to this unit...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now