Thread View: borland.public.cppbuilder.database.ado
10 messages
10 total messages
Started by George P Boutwell
Fri, 09 Nov 2007 17:08
BCB6 ADO problem with Vista
Author: George P Boutwell
Date: Fri, 09 Nov 2007 17:08
Date: Fri, 09 Nov 2007 17:08
6 lines
1199 bytes
1199 bytes
All our BCB6 applications that we have built, lock-up immediately when we make a connection with the ADOConnection object. It looks like it it is having problem deep in the ADO components in Vista, the error/bug happens deep in the Kernel/ADO stack. Anyone else experinced this problem and have advice on supporting BCB6 ADO apps under Vista when it won't even allow them to connect. Thanks, George
Re: BCB6 ADO problem with Vista
Author: Clayton Arends
Date: Fri, 09 Nov 2007 20:24
Date: Fri, 09 Nov 2007 20:24
9 lines
1574 bytes
1574 bytes
Hey George, long time no talk. Looks like you're doing some legacy support? Our main product is an ADO tool that we currently still compile with BCB6. I develop on Vista and we haven't had this problem on any of our Vista boxes. Have you tried making a new app that connects to a DB with ADO and executes a simple query? What database driver are you using? Does it work using a Jet driver to a simple Access (MDB) database? Clayton
Re: BCB6 ADO problem with Vista
Author: George P Boutwell
Date: Mon, 12 Nov 2007 03:07
Date: Mon, 12 Nov 2007 03:07
23 lines
2305 bytes
2305 bytes
"Clayton Arends" <nospam_claytonarends@hotmail.com> wrote:
>Hey George, long time no talk. Looks like you're doing some legacy support?
:) Yeah. Didn't realize that you did ADO and would be in the same shoes. Yeah, been I while, sorry I hadn't chatted. :)
>Our main product is an ADO tool that we currently still compile with BCB6.
>I develop on Vista and we haven't had this problem on any of our Vista
>boxes. Have you tried making a new app that connects to a DB with ADO and
>executes a simple query? What database driver are you using? Does it work
>using a Jet driver to a simple Access (MDB) database?
>
Yes, we see the problem even debugging our application in BCB6 under Vista. We see the problem creating a new BCB6 application with just an ADOConnection dropped on it and the string below 'built' using the ADO String Builder wizard/helper. We lock/freeze when we run the app in debugger, with UAC turned off completely or turned on - deson't seem to matter. It's an MS SQL app using ADO to connect with it.
ADO Connection String is something like this:
str = "Provider=SQLOLEDB.1;Integrated Security=SSPI;";
str += "Data Source=")+_Server+_T(";";
str += "Initial Catalog=")+_Database+_T(";";
so:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Data Source=MyServer;Initial Catalog=MyDB;
Re: BCB6 ADO problem with Vista
Author: Clayton Arends
Date: Mon, 12 Nov 2007 18:27
Date: Mon, 12 Nov 2007 18:27
48 lines
3104 bytes
3104 bytes
> :) Yeah. Didn't realize that you did ADO and would be in the same shoes.
I'm not as versed in ADO as with the rest of the VCL but I know enough to be
dangerous.
> We lock/freeze when we run the app in debugger, with UAC turned off
> completely or turned on - deson't seem to matter.
If you lock when you run the app then try running BCB6 as administrator.
This is what I have to do when I debug administrative applications.
> It's an MS SQL app using ADO to connect with it.
To eliminate the UAC and administrative privileges have you tried connecting
via a plain Jet connection yet? If even that doesn't work then I'm afraid
I'd be out of ideas since that's about as general a connection as one can
create using ADO. The only step at that point would be to make sure you
have all of the correct drivers installed.
If the Jet connection succeeds then we can move to the next step? Have you
added a Vista manifest resource to your application yet? If not, here is
the resource that I use which tells Vista to run the application with
administrative privileges:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
If you need a RES file for that let me know and I'll email it (or put in
.attachments).
> Provider=SQLOLEDB.1;Integrated Security=SSPI;Data Source=MyServer;
> Initial Catalog=MyDB;
Do you have a SQLServer database that doesn't require integrated security?
Try using a standard username and password logon and see if that can get in.
That's the way we have our SQLServer connections set up here (we haven't
gotten too fancy with security settings yet).
HTH,
Clayton
Re: BCB6 ADO problem with Vista
Author: George P Boutwell
Date: Mon, 12 Nov 2007 21:55
Date: Mon, 12 Nov 2007 21:55
61 lines
4022 bytes
4022 bytes
"Clayton Arends" <nospam_claytonarends@hotmail.com> wrote: >I'm not as versed in ADO as with the rest of the VCL but I know enough to be >dangerous. :). I thought I was good, but then I've never had any problems until trying our apps in Vista. >> We lock/freeze when we run the app in debugger, with UAC turned off >> completely or turned on - deson't seem to matter. > >If you lock when you run the app then try running BCB6 as administrator. >This is what I have to do when I debug administrative applications. Same problem with BCB6 run as administrator and BCB6 run with UAC turned off. >> It's an MS SQL app using ADO to connect with it. > >To eliminate the UAC and administrative privileges have you tried connecting >via a plain Jet connection yet? If even that doesn't work then I'm afraid ? Not sure what you mean by this. Other apps built against -*roughly*- the same library but using Visual Studio & .NET using -*roughly*- the same ADO Connection (Almost verbatum the above string + "MultipleResultSets=true") string work fine in Vista. >I'd be out of ideas since that's about as general a connection as one can >create using ADO. The only step at that point would be to make sure you >have all of the correct drivers installed. > >If the Jet connection succeeds then we can move to the next step? Have you >added a Vista manifest resource to your application yet? If not, here is >the resource that I use which tells Vista to run the application with >administrative privileges: > ><?xml version="1.0" encoding="UTF-8" standalone="yes"?> ><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> > <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> > <security> > <requestedPrivileges> > <requestedExecutionLevel level="requireAdministrator" /> > </requestedPrivileges> > </security> > </trustInfo> ></assembly> > >If you need a RES file for that let me know and I'll email it (or put in >.attachments). You can e-mail it to the e-mail above or post it to .attachments and I'll try to get it from there. Or point me to what I'd need to know to turn the above XML into an .RES that I can include with/in my BCB6 app... >> Provider=SQLOLEDB.1;Integrated Security=SSPI;Data Source=MyServer; >> Initial Catalog=MyDB; > >Do you have a SQLServer database that doesn't require integrated security? :). No we considered that 'evil' and opted to control completely access using the Active Directory on our Domain. >Try using a standard username and password logon and see if that can get in. >That's the way we have our SQLServer connections set up here (we haven't gotten too fancy with security settings yet). > Thanks for your help. We'll re-try a few of these things to see if we get further and keep you posted. I'd really like info on how to add the admin XML via RES to our BCB6 apps, or an .RES that we can include in our applications. George
Re: BCB6 ADO problem with Vista
Author: Clayton Arends
Date: Tue, 13 Nov 2007 04:31
Date: Tue, 13 Nov 2007 04:31
34 lines
2869 bytes
2869 bytes
>> To eliminate the UAC and administrative privileges have you tried >> connecting via a plain Jet connection yet? If even that doesn't work >> then I'm afraid > ? Not sure what you mean by this. Other apps built against -*roughly*- > the same library but using Visual Studio & .NET using -*roughly*- the same > ADO Connection (Almost verbatum the above string + > MultipleResultSets=true") string work fine in Vista. I meant "to eliminate any potential UAC and administrative privilege problems from fouling up our tests." I'm trying to get a baseline to see if *any* ADO works on your system. Using a Jet driver and connecting to an MDB is just to get a base. If that works then we can go from there. > You can e-mail it to the e-mail above ... Emailed. > :). No we considered that 'evil' and opted to control completely access > using the Active Directory on our Domain. Understandable. If there is any way you can set up a test SQLServer DB that allows explicit user/password access then that may help in diagnosing this problem. > I'd really like info on how to add the admin XML via RES to our BCB6 apps, > or an .RES that we can include in our applications. One thing I forgot to mention in the email I sent is that all Vista apps should have a security manifest regardless of their need for administrative privileges. If your app will never need admin privileges (or won't most of the time until elevation is required) then the res will be the same but instead of the text "requireAdministrator" it should read "asInvoker". Clayton
Re: BCB6 ADO problem with Vista
Author: Viatcheslav Valerievitch Vassili...
Date: Tue, 13 Nov 2007 11:22
Date: Tue, 13 Nov 2007 11:22
66 lines
4328 bytes
4328 bytes
Check that you have set Connected = false for all TADOConnection objects and
Active = false for all ADO TDataSet descendants (TADOQuery, TADODataSet) in
all forms and data modules in IDE, and make sure that you connect to MS SQ
Server only from code. Lock-up can happen if MS SQL Server provider tries to
connect to server that does not exist (i.e. server with specified name does
exist on your development machine but does not exist on computer where
program locks up).
> str = "Provider=SQLOLEDB.1;Integrated Security=SSPI;";
> str += "Data Source=")+_Server+_T(";";
> str += "Initial Catalog=")+_Database+_T(";";
What is a type of str? Anyway it seems that you combine ASCII and Unicode
(strings in form _T"..."). Try to use either ASCII or Unicode, better to use
WideString. Check what is exactly in TADOConnection.ConnectionString just
before you call Connected = true (or Open()), to see that string is not
mangled by combining ASCII and Unicode. Try to have str of type WideString
and use all constants without _T.
WideString str = WideString("...") + WideString("...")
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"George P Boutwell" <gboutwel@valleyhope.com> �������/�������� � ��������
���������: news:4737d17e$1@newsgroups.borland.com...
>
> "Clayton Arends" <nospam_claytonarends@hotmail.com> wrote:
>>Hey George, long time no talk. Looks like you're doing some legacy
>>support?
>
> :) Yeah. Didn't realize that you did ADO and would be in the same shoes.
> Yeah, been I while, sorry I hadn't chatted. :)
>
>>Our main product is an ADO tool that we currently still compile with BCB6.
>>I develop on Vista and we haven't had this problem on any of our Vista
>>boxes. Have you tried making a new app that connects to a DB with ADO and
>>executes a simple query? What database driver are you using? Does it
>>work
>>using a Jet driver to a simple Access (MDB) database?
>>
>
> Yes, we see the problem even debugging our application in BCB6 under
> Vista. We see the problem creating a new BCB6 application with just an
> ADOConnection dropped on it and the string below 'built' using the ADO
> String Builder wizard/helper. We lock/freeze when we run the app in
> debugger, with UAC turned off completely or turned on - deson't seem to
> matter. It's an MS SQL app using ADO to connect with it.
>
> ADO Connection String is something like this:
>
> str = "Provider=SQLOLEDB.1;Integrated Security=SSPI;";
> str += "Data Source=")+_Server+_T(";";
> str += "Initial Catalog=")+_Database+_T(";";
>
> so:
> Provider=SQLOLEDB.1;Integrated Security=SSPI;Data Source=MyServer;Initial
> Catalog=MyDB;
>
>
Re: BCB6 ADO problem with Vista
Author: George P Boutwell
Date: Wed, 14 Nov 2007 16:03
Date: Wed, 14 Nov 2007 16:03
24 lines
3612 bytes
3612 bytes
"George P Boutwell" <gboutwel@valleyhope.com> wrote: >All our BCB6 applications that we have built, lock-up >immediately when we make a connection with the ADOConnection >object. It looks like it it is having problem deep in the ADO >components in Vista, the error/bug happens deep in the >Kernel/ADO stack. Anyone else experinced this problem and >have advice on supporting BCB6 ADO apps under Vista when it >won't even allow them to connect. I wanted to update everyone on this thread - bottom line is we have our application(s) finally working (sorta) under Vista but wanted to give the details of what we discovered along the way for anyone having a similar problem... In all honest most my prior posts where from memory. We had initially tried BCB6 under Vista and when we hit this problem originally we didn't have time to track it down, so we opted to go Virtual Machine of XP in Vista to still get things done. This was OK, but is a major productivity draw if you ask me... So we kinda shelved this problem until we had more time to look into it. I started the thread to get the ball rolling on solving this problem (hopefully) for good. So we took a step back and tried several things: We started by building an "Default" BCB6 App With TADOConnection dropped on a form and TADOQuery dropped on the form, a Button to Set TADOQuery->Active = true, this app worked, which is a good sign, but our application(s) still didn't. So we looked at the differences in our app(s) verses the above. There where 2 major differences - 1) Our Apps was creating TADOConnection & TADOQuery in code & 2) Our Apps where creating the TADOConnection in shared dll library. We modified the "Default" BCB6 App above to create the TADOConnection and TADOQuery in code like our shared dll library was, this of course worked under Vista, but left us scratching our head about why it would work in an EXE but not an DLL. We did some more digging in the DLL code and found that to avoid an error message about needing to call CoInitialize we call CoInitialize in the DLLMain (PROCESS_ATTACH), when we comment this line of code out, we get the error message about needing to call CoInitialize, but the lock-up in Vista is gone. So apparently our problem is the we call CoInitialize in a DLL - this code works fine in XP, but is an problem apparently in Vista. Haven't yet worked out how we are going to deal with this, but at least we are able to run our apps in Vista, under BCB6 and debug/build/test them... Thanks for all your help. Anyone have any thoughts on how we can get around the lock-up & message by calling the CoInitialize? George
Re: BCB6 ADO problem with Vista
Author: George P Boutwell
Date: Wed, 14 Nov 2007 16:13
Date: Wed, 14 Nov 2007 16:13
16 lines
1916 bytes
1916 bytes
"Viatcheslav Valerievitch Vassiliev" <support@oledbdirect.com> wrote:
>> str = "Provider=SQLOLEDB.1;Integrated Security=SSPI;";
>> str += "Data Source=")+_Server+_T(";";
>> str += "Initial Catalog=")+_Database+_T(";";
>
>What is a type of str? Anyway it seems that you combine ASCII and Unicode
>(strings in form _T"..."). Try to use either ASCII or Unicode, better to use
>WideString. Check what is exactly in TADOConnection.ConnectionString just
>before you call Connected = true (or Open()), to see that string is not
>mangled by combining ASCII and Unicode. Try to have str of type WideString
>and use all constants without _T.
>
>WideString str = WideString("...") + WideString("...")
str is 'essentially' std::string and yeah... I meant to trim out the _T() stuff, but missed a few places... We compile BCB6 apps almost exclusively in non-UNICODE. But the same code when we compile in VS.net is almost exclusively compiled with UNICODE enabled.
Re: BCB6 ADO problem with Vista
Author: Verne H. Bohlender
Date: Sun, 02 Dec 2007 19:39
Date: Sun, 02 Dec 2007 19:39
31 lines
2150 bytes
2150 bytes
George, I'm new to this group but have been playing around with
VCL a bit and also VB using ACCESS files but still to learn how
to make a very simple program to use the VCL operation to use
same.
I've done a few good ones using VB but getting to like this
program and also having Vista loaded on my Laptop upstairs I
could possibly give yours a try to see if I could figure out
what's what with same. The more the merrier they say.
All I want really is to make a simple Telephone Number
program to replace my much larger AddressBook program that I now
use and I just need the primary names e.g: 1st Name, Last Name,
City and of course the Telephone number. So you see it would be
very simple.
Verne
"George P Boutwell" <gboutwel@valleyhope.com> wrote in message
news:4734a20d$1@newsgroups.borland.com...
>
> All our BCB6 applications that we have built, lock-up
> immediately when we make a connection with the ADOConnection
> object. It looks like it it is having problem deep in the ADO
> components in Vista, the error/bug happens deep in the
> Kernel/ADO stack. Anyone else experinced this problem and have
> advice on supporting BCB6 ADO apps under Vista when it won't
> even allow them to connect.
>
> Thanks,
>
> George
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads