I cant seem to make this statement work in a header file :
#import "msado15.dll"
Ive also tried the full path to msado.dll. Ive tried to clean the solution and full recompile. I looked in the target path and msado.tlh isnt getting generated.
The error is:
IntelliSense: cannot open source file "c:/Users/john smith/documents/visual studio 2010/Projects/try7db/try7db/Debug/msado15.tlh" c:\users\john smith\documents\visual studio 2010\projects\try7db\try7db\database.h
can someone tell me what Im doing wrong?
btw my ultimate goal is to connect/read/write to an existing SLQCE database.
I've seen the import exactly the way Ive written it in a couple of examples on the web. Also there exists no msado.tlb inside "c:\Program Files (x86)\Common Files\System\ADO" I tried to import "c:\Program Files (x86)\Common Files\System\ADO\msado28.tlb" and got the same type of error complaining about a tlh file.
For awhile today "#import c:\Program Files (x86)\Common Files\System\ADO\msado.dll" was working and it even had generated a msadodll.tlh that I could see in my project. Not sure what happened, but is just stopped working (not sure what I did to provoke that).
You import the tlb and the compiler generates the thl file.
I just tested it and on VC6, 2005, 2008, 2010. It compiles on VC6, the others have a namespace issue, but I don't get the error you see. You need to sort out your environment.
Seems there must be an issue with my VS2010 which is odd since I just recently installed it. I have a side by side installation of VS2008 that I tried this in. It works, as you already said, with some issues which were resolved with the following modifications:
I suppose I should begin by uninstalling and reinstalling VS2010 if I want to get it to work in that? I suppose Im happy enough to have it working in VS2008 no matter how that part turns out.