Help with ADO connectivity in Delphi XE

The company I work for has finally started migrating applications from Delphi 5 and 7 to Delphi XE and XE2.  But, I am having a problem with a TADOConnection.

A simple application built in D5 to connect to a MS SQL database works.  But the same code compiled in Delphi XE will not connect.  When the user's role changes from User to Power User, they can connect to the database in the app compiled in XE.  

The workstation that the user is running from is Windows XP.  The SQL Server version is 2005.  MDAC version 2.8

Unfortunately, we have been unable to simulate their environment, and we are not allowed to directly connect to their hospital network to test on.

Any ideas why this is happening, or suggestions on how to fix it will be greatly appreciated.



Thanks in advance,
Tom
0
Tom
11/17/2011 9:36:51 PM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

9 Replies
1189 Views

Similar Articles

[PageSpeed] 4

I had some similar issues with this when I was using an incorrect 'Provider' in the connection string of the TADOConnection object - can you share with us the parameters you've got set up for that?

Jeff

> {quote:title=Tom Niderost wrote:}{quote}
> The company I work for has finally started migrating applications from Delphi 5 and 7 to Delphi XE and XE2.  But, I am having a problem with a TADOConnection.
> 
> A simple application built in D5 to connect to a MS SQL database works.  But the same code compiled in Delphi XE will not connect.  When the user's role changes from User to Power User, they can connect to the database in the app compiled in XE.  
> 
> The workstation that the user is running from is Windows XP.  The SQL Server version is 2005.  MDAC version 2.8
> 
> Unfortunately, we have been unable to simulate their environment, and we are not allowed to directly connect to their hospital network to test on.
> 
> Any ideas why this is happening, or suggestions on how to fix it will be greatly appreciated.
> 
> 
> 
> Thanks in advance,
> Tom
0
Jeff
11/18/2011 4:22:48 PM
> {quote:title=Jeff Burhans wrote:}{quote}
> I had some similar issues with this when I was using an incorrect 'Provider' in the connection string of the TADOConnection object - can you share with us the parameters you've got set up for that?
> 
> Jeff
> 

Jeff,

Thanks for your interest.  Here is the connection string and a snippet of code.  I was connecting by including the username and pwd in the connection string, but I read someplace that the OPEN(username, pwd) way would be a better way to connect.

{code}
  //  'Provider=SQLOLEDB.1;Initial Catalog=DSS;Data Source=127.0.0.1'

        begin
          ConnectionString := 'Provider=SQLOLEDB.1;' +
            'Initial Catalog=' + PSQLDatabase + ';' +
            'Data Source=' + PSQLServername;

          // Connect to SQL Server
          SQLUsername := PSQLUsername;
          SQLPassword := PSQLPassword;
        end;


        Open(SQLUsername, SQLPassword);
{code}

Thanks,
Tom
0
Tom
11/18/2011 6:26:59 PM
I did a bit of searching and found this article that seems tangentially related to your problem - again an issue with the provider in the connection string.
https://forums.embarcadero.com/thread.jspa?messageID=374695&tstart=0



> {quote:title=Tom Niderost wrote:}{quote}
> > {quote:title=Jeff Burhans wrote:}{quote}
> > I had some similar issues with this when I was using an incorrect 'Provider' in the connection string of the TADOConnection object - can you share with us the parameters you've got set up for that?
> > 
> > Jeff
> > 
> 
> Jeff,
> 
> Thanks for your interest.  Here is the connection string and a snippet of code.  I was connecting by including the username and pwd in the connection string, but I read someplace that the OPEN(username, pwd) way would be a better way to connect.
> 
> {code}
>   //  'Provider=SQLOLEDB.1;Initial Catalog=DSS;Data Source=127.0.0.1'
> 
>         begin
>           ConnectionString := 'Provider=SQLOLEDB.1;' +
>             'Initial Catalog=' + PSQLDatabase + ';' +
>             'Data Source=' + PSQLServername;
> 
>           // Connect to SQL Server
>           SQLUsername := PSQLUsername;
>           SQLPassword := PSQLPassword;
>         end;
> 
> 
>         Open(SQLUsername, SQLPassword);
> {code}
> 
> Thanks,
> Tom
0
Jeff
11/18/2011 7:57:52 PM
> {quote:title=Jeff Burhans wrote:}{quote}
> I did a bit of searching and found this article that seems tangentially related to your problem - again an issue with the provider in the connection string.
> https://forums.embarcadero.com/thread.jspa?messageID=374695&tstart=0

Thanks Jeff, I will try that over the next week and let you know if it fixed it.  It sounds promising!  the problem is that I need to build a test app to simulate all kinds of connectivity, and then the customer (hospital) will try it out to see what works.  I will only get one shot at this and I must cover all the bases I can.


Thanks,
Tom
0
Tom
11/18/2011 8:29:26 PM
My pleasure! I hope that it helps...That's awful that you are that limited...Any way you can set up a simluated server in your lab and test it that way? Duplicate the error, etc. etc...I'm probably preaching to the choir here. LOL I've worked with Health Care for a long time and know how frustrating it can be.

Good Luck!

Jeff


> {quote:title=Tom Niderost wrote:}{quote}
> > {quote:title=Jeff Burhans wrote:}{quote}
> > I did a bit of searching and found this article that seems tangentially related to your problem - again an issue with the provider in the connection string.
> > https://forums.embarcadero.com/thread.jspa?messageID=374695&tstart=0
> 
> Thanks Jeff, I will try that over the next week and let you know if it fixed it.  It sounds promising!  the problem is that I need to build a test app to simulate all kinds of connectivity, and then the customer (hospital) will try it out to see what works.  I will only get one shot at this and I must cover all the bases I can.
> 
> 
> Thanks,
> Tom
0
Jeff
11/18/2011 8:32:26 PM
actually you need to be a little more specific in your
examples;

Assuming your are using a TADOConnection object 
it would look something like this

const
  cLOGIN = 'someone';
  cPASWD = 'something';

var
  fDBName: string;
  fDBServer: string;
  fADOConnection: TADOConnection;

begin
  fADOConnection := TADOConnection.create(nil);  //note embedded semicolins
  fADOconnection.CommandTimeout := 1800; // 30 minutes
  fADOConnection.ConnectionString := 'Provider=SQLOLEDB.1;'+
                            'Persist Security Info=True;'+
                             'OLE DB Services=-1;'+ // if not trusted then '-2'
                              'User ID='+cLOGIN+';'+
                               'Password='+cPASWD+';'+
                                'Data Source='+fDBServer+';'+
                                 'Initial Catalog='+fDBName+';';
{ could included these also
      'Application Name=' + Get_Filename + ';' +
      'Workstation ID=' + Get_Computer_Name + ';' +
      'LoginName=' + Get_User_Name + ';' +
}
  fADOConnection.Connected := true;
0
Dennis
11/19/2011 3:19:12 PM
Thanks Dennis.  I have not had the opportunity to test this yet at the customer site.  The remote testing that we were able to do failed (so far).  The process that we use to test is painful:

1. Create a test app
2. Put the test app on our FTP site
3. Ask the customer to copy from the FTP site to their application folder,
4. Schedule a "Live Meeting" to run the application and see what the results are.

We have done this about 3 times in the past 3 months, and we are beginning to look silly.  Each test has failed.  I tried to duplicate the connection string as closely to the original D5 compiled application as possible.  I changed "Initial Catalog" to "Database" in hopes that would make a difference.  That was the latest test.  We are going to try to have an administrator set the option on the exe file to enabled for "“Allow non-administrators to run this program".  I doubt that this will fix the issue, 
but that is our next test.

I am hoping that I will be able to make a trip to the customer hospital site and can create a test app that we can continuously change the connection string until we find what works.  

We will see...

Tom

> {quote:title=Dennis Passmore wrote:}{quote}
> actually you need to be a little more specific in your
> examples;
> 
> Assuming your are using a TADOConnection object 
> it would look something like this
> 
> const
>   cLOGIN = 'someone';
>   cPASWD = 'something';
> 
> var
>   fDBName: string;
>   fDBServer: string;
>   fADOConnection: TADOConnection;
> 
> begin
>   fADOConnection := TADOConnection.create(nil);  //note embedded semicolins
>   fADOconnection.CommandTimeout := 1800; // 30 minutes
>   fADOConnection.ConnectionString := 'Provider=SQLOLEDB.1;'+
>                             'Persist Security Info=True;'+
>                              'OLE DB Services=-1;'+ // if not trusted then '-2'
>                               'User ID='+cLOGIN+';'+
>                                'Password='+cPASWD+';'+
>                                 'Data Source='+fDBServer+';'+
>                                  'Initial Catalog='+fDBName+';';
> { could included these also
>       'Application Name=' + Get_Filename + ';' +
>       'Workstation ID=' + Get_Computer_Name + ';' +
>       'LoginName=' + Get_User_Name + ';' +
> }
>   fADOConnection.Connected := true;
0
Tom
1/30/2012 1:51:02 PM
The problem is that the hospital has the direct SQL Server connection blocked to this application.  Nobody seems to be able to take the time to assist us in getting this fixed. 

We found a different way to connect to SQL Server by using a middle tier that is in place.  This middle tier has been in place but not used because this in not the primary purpose of the module.  

It now works fine, but the proper solution was never found.

Thank you for trying to help.

Tom
0
Tom
8/29/2012 12:26:33 PM
This is the solution to this problem.

> {quote:title=Tom Niderost wrote:}{quote}
> The problem is that the hospital has the direct SQL Server connection blocked to this application.  Nobody seems to be able to take the time to assist us in getting this fixed. 
> 
> We found a different way to connect to SQL Server by using a middle tier that is in place.  This middle tier has been in place but not used because this in not the primary purpose of the module.  
> 
> It now works fine, but the proper solution was never found.
> 
> Thank you for trying to help.
> 
> Tom
0
Tom
8/29/2012 12:27:22 PM
Reply:

Similar Artilces:

Convert Delphi 5 ADO App to Delphi 2007 ADO.NET
I have an appliction tha that is writen in Delphi 5 with ADOConnetion, ADOTable, and ADOQuery components. I need to upgrade to Delphi 2007 and use ADO.NET. I have the program building in with Delphi 2007. Is there anything I need to do to convert the ADO to ADO.NET? > I need to upgrade to Delphi 2007 and use ADO.NET. Why ? -- With best regards, Dmitry Arefiev AnyDAC (www.anydac.com) - Oracle, MS SQL Server, IBM DB2, MySQL, Firebird, Interbase, PostgreSQL, Sybase ASA, SQLite, MS Access, DBX, ODBC, InMem - universal high-speed native data access engine Reasons for ...

Delphi 6 to Delphi 2010 upgrade and ADO
We have an application written in Delphi 6 Professional that uses ADO to access databases servers that may be on other PCs in our network. We want to move to Delphi 2010 but can't decide if we need Professional or Enterprise. 2010 Pro has dbGO - will this give us the same functionality as the ADO components we use in Delphi 6 Pro? Thanks, Keith > 2010 Pro has dbGO - will this give us the same functionality as the > ADO components we use in Delphi 6 Pro? Yes. > {quote:title=Joachim Uersfeld wrote:}{quote} > > 2010 Pro has dbGO - will this give us the same func...

ASA7 ADO & Delphi ADO ?? Anyone is using it?
Any comments? Is it working? Any Problems? Thanks Hi, PR <noemail@no.com> schrieb in im Newsbeitrag: BoTThJaq$GA.89@forums.sybase.com... > Any comments? Is it working? Any Problems? I tried to connect to ASA7 via the new OLE DB - Provider and ADOExpress from Delphi 5.01. No chance. Only the error message 'Invalid Enum Value'. About the new provider I haven't heard anything good until now... Regards Frank Frank, I've experienced the same problem with the ASA 7 OLEDB Provider. I'm not sure if this is a bug in the AsaProvider or Delp...

Delphi XE + TClientDataSet + ADO error
Hi, I have the error reported in this QC article: http://qc.embarcadero.com/wc/qcmain.aspx?d=88928 Anybody knows how to fix it ? Regards ...

A problem about connecting ASA by ADO component of Delphi?
Is there anyone to try to use ADO component of Delphi to connect ASA? I fail to do it. I manipulate database by TDataSource,TADOQuery,TConnection components of Delphi, and set up connection with ASA guide. When running the program, the connection is set up successfully. But a EoleException is thrown once I make a query using TADOQuery. System prompt "unknown error". Who knows what happened? Is it a compatible problem between ASA driver(ASAProv) and ADO component of Delphi? (All are ok when connecting ASA by BDE components). Is there anyone to try this?? ...

ADO Connection not working if Delphi and Oracle not on same computer
I had Delphi working fine with Oracle using ADO when Oracle 11g is on the same pc as Delphi. I tried to use Delphi from another pc and I do not know what to enter for "Servername" on the Build connection string screen. Originally I had tough I needed to enter the computer name, aka Hostname. I also tried entering a name of the oracle instance or Oracle service, and also tried using this info in for format of hostname.service and \\hostname-service. Can someone help -is it just the computer name, is it the ip address, does it need the Oracle instance name? Thanks. steve Hel...

Connection String for ADO Database in delphi prism
Hi, I want to connect to a database with ADO and aspx. from VB code what is the equivalent in delphi prism ? .... Dim MyReader as sqldatareader Dim MyConnection as sqlconnection = new sqlconnection() myConnection.connectionstring = configurationmanager.connectionstrings("DSN_MYDB").connectionstring Dim mycommand as sqlcommand = new sqlcommand() mycommand.commandtext="select * from mytable" mycommand.commandtype = commandtype.text mycommand.connection = myconnection mycommand.connection.open() Myreader=mycommand.executereader(commandbehavior.closeconnec...

Several Delphi ADO Database help questions
Okay, I have an Access database connected to an ADO dbgrid in delphi through ADO connections. there are a few problems I'm having with it. Firstly, I have a lookup table for one of my columns set up in access, it's for a supplierID column, it gets the supplier ID number and the supplier name from a suppliers table for you to select from. This doesn't work in the delphi DBGrid, I have looked for ways to allow it to display but all I've found are complex blocks of code that don't work for me and that I don't have the skill to adapt. Secondly, I have several buttons ...

Need help to allow a working Delphi 3 project to build on Delphi XE
How do I adjust this working Delphi 3 program that uses OLEAUTO and OLE2 to work on the newer Delphi XE, Program code is below this, errors are here : Checking project dependencies... Compiling admn_api.dproj (Debug, Win32) dcc command line for "admn_api.dpr" c:\program files (x86)\embarcadero\rad studio\8.0\bin\dcc32.exe -$O- -$W+ --no-config -M -Q -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE; DbiProcs=BDE;DbiErrs=BDE -DDEBUG -I"c:\program files (x86)\embarcadero\rad studio\8.0\lib\Win32\release";"C:\Users\Administrator\Documents\RAD Studio...

ADO to ADO.NET help
Hi, I am converting application ASP to ASP.NET.What is the equivalent code in ADO.NET. For each F in RS.Fields FieldName = F.Name Next Thanks, Nate If it is forward only, then you can use datareader for more info on this, check below link Datareader on MSDN Hope it helps!Sreedharhttp://www.w3coder.orgweblog http://weblogs.asp.net/skoganti...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Connecting to MS-SQL-Express with ADO and Delphi 6
Hi, I have installed MS-SQL Express and created a database - Test1 - and a table within that database called Equipment with a few columns. I have created a new delphi 6 application with a TADOConnection component. When creating the connection string I have chosen the "Microsoft OLE DB Provider for SQL Server", then entered the server name as "mtpcname\SQLExpress1" and selected Windows NT Integrated security. Clicking the Test Connection button says that the connection was successful. However the drop down list to select the database on the server only list ...

Help TeamSybase: Cannot use ASA with Delphi via ADO
Hello, I just installed ASA 60 days trial and I am testing with Delphi 6 and ADO, using TADODataset components. I am getting the following problems: when I post any record, trailing blanks are inserted in every TStringField (VARCHAR in ASA). When I post records with TMemoField or TBlobField (LONG VARCHAR), it raises a "Count field incorrect". I did't see this behaviour in other servers. Regards, Frank What are the version and build number of your server? Are you using the sample database or a database you created? If you created it, did you use the BLANK...

Web resources about - Help with ADO connectivity in Delphi XE - embarcadero.delphi.ado

TE Connectivity - Wikipedia, the free encyclopedia
TE Connectivity Ltd. designs and manufactures connectivity and sensor solutions for a variety of industries including automotive, industrial ...

Mark Zuckerberg Goes Into Detail On Facebook Connectivity Lab, Internet.org
Perhaps Facebook Co-Founder and CEO Mark Zuckerberg is just a wee bit excited about the Connectivity Lab , the initiative aimed at using high-altitude ...

The power of connectivity
By Keven McCammon, site data center manager, Facebook Forest City Data Center Today we announced that we’re partnering with the Town of Forest ...

Facebook, Internet.org launch Connectivity Lab
... CEO Mark Zuckerberg shed some light on the company’s acquisition of drone-maker Titan Aerospace, announcing the launch of Facebook’s Connectivity ...

Samsung Galaxy S3: Connectivity demo - USB OTG, MHL, bluetooth keyboards/mice, games controllers - YouTube ...
AndroidNZ.net - the best source for Galaxy S3 content! For navigation in the video use these links: USB Pendrive @0:55, 500GB portable drive ...

Mid-2012 MacBook Airs offer improved performance and connectivity
Believe it or not, it's been nearly four and a half years since Apple released the original MacBook Air. At the time, it was revolutionary in ...

Connectivity is key in society
They’re billing it as the place where Lewisham meets Summer Hill meets the city – and with good reason.

BMW to launch new connectivity service
Soon your car will notify the dealer when it’s due for a service. BMW Australia will introduce a new suite of in-car connectivity apps in its ...

The key to a successful hybrid cloud infrastructure? Flexible connectivity
It's becoming increasingly clear that - for most organisations - taking a 'hybrid' approach to cloud adoption makes sound business sense.

Facebook Connectivity Lab promotes access to Internet in remote areas - CTV News
Facebook is giving more details about its effort to connect remote parts of the world to the Internet - and it involves drones, lasers and satellites. ...

Resources last updated: 1/5/2016 10:34:30 AM