Unable to Connect in IDE

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Malc123
Posts: 9
Joined: Mon 04 Jul 2011 13:35

Unable to Connect in IDE

Post by Malc123 » Mon 04 Jul 2011 13:46

Hi

I have a problem connecting when running my application through the IDE. If I drop an msconnection on to my form I can open it and browse my sql servers. When I run the application through the IDE the program just errors out and won't connect.
I have put an msconnectDialog on the form when the application is run it will not find a list of the servers. When I drop down the server box I get an error EconvertError with message 'Format '%i' invalid or incompatible with argument.
If I compile the application and run it from the folder outside the IDE all is normal.

No fire wall on.

The odd thing is some applications work correctly

Windows 7 64
Delphi XE
SDAC 5.10.0.7

AndreyZ

Post by AndreyZ » Mon 04 Jul 2011 15:41

Hello,

Please try the following:
- create a new application;
- drop the TMSConnection and TButton components onto the form;
- add the SdacVcl unit to the USES clause (to enable the default connect dialog);
- write the following code:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  MSConnection1.Open;
end;
- run the application and click the button.
Can you connect this way? Does the error with the server list occur?

Malc123
Posts: 9
Joined: Mon 04 Jul 2011 13:35

Sdac

Post by Malc123 » Mon 04 Jul 2011 15:53

Thank you

Yes this works creating from new.

I have a small application which I have edited to have the same as your example. When I run it I get the error. If I start a new project and copy the components off the original form to the new project it works. But I cannot go through the main application like this.

This is a completely clean install of windows and Delphi.

AndreyZ

Post by AndreyZ » Tue 05 Jul 2011 08:20

It seems that the problem is caused by some project options. Please send me your small application that demonstrates the problem to andreyz*devart*com.

Malc123
Posts: 9
Joined: Mon 04 Jul 2011 13:35

Example now sent

Post by Malc123 » Tue 05 Jul 2011 10:08

I have now sent you an example

AndreyZ

Post by AndreyZ » Tue 05 Jul 2011 14:06

I've investigated your project. The problem with connecting to SQL Server is caused by the following lines in your project (Project1.dproj):

Code: Select all


  '\cpm-s00\users$\MJL\ShopFloor Delphi XE'
If you remove these lines from the Project1.dproj file, you will be able to connect to SQL Server. This problem isn't caused by SDAC. I've checked ADO components as well, and they showed the same error. For more information about this problem, please contact the Embarcadero support.

Malc123
Posts: 9
Joined: Mon 04 Jul 2011 13:35

Post by Malc123 » Wed 06 Jul 2011 07:22

Andrey

Brilliant thank you very much. All working now

AndreyZ

Post by AndreyZ » Wed 06 Jul 2011 07:40

Feel free to contact us if you have any further questions about SDAC.

Post Reply