?
Solved

Build ADO Connection String Problem

Posted on 2003-11-07
6
Medium Priority
?
361 Views
Last Modified: 2013-11-23
When I try to create an ADO connection string by clicking on the "Build" button nothing happens.  I get no dialog box or anything.  Currently I am having coworkers build the connection string on their computers and then emailing it to me.  If I paste their string into the Connection String edit box it works fine.

Any ideas of why my Build button won't work?

Thanks,
Pet
0
Comment
Question by:PetMime
  • 3
  • 3
6 Comments
 
LVL 3

Accepted Solution

by:
ThoseBug earned 500 total points
ID: 9718473
try this   //this is just un example..hope this help
procedure TForm1.Button1Click(Sender: TObject);
    var
    STRConn,ServerName, UserName, Password, databasename : String;
    begin
    ServerName := InputBox('Input server name','Server Name','MyServer');
    UserName    :=  InputBox('Input User Name','User Name','sa');
    Password    :=  InputBox('Input Password','Password','myPassword');
    databasename :=  InputBox('Input Database','Database','myDatabase');

    STRConn :='Provider=SQLOLEDB.1; Password='+ Password+';Persist Security Info=True;User ID='+ Username +
              ' ; Initial Catalog='+ DataBaseName +';Data Source='+ServerName;
    With ADOMain do
    begin
    Connected := False;
    ConnectionString := STRConn;
    Connected := True;

    if connected then showmessage('the connection was succesfull');


    end;

end;
0
 
LVL 3

Expert Comment

by:ThoseBug
ID: 9718485
i was thinking..may be you are not in the same domain, or if your server have user may be you donthave permissions...try with the sa user...(if is SQL)
0
 

Author Comment

by:PetMime
ID: 9718597
Thanks for the response.  I'll give your code a try tomorrow.  

As far as me not being on the same domain or having permission goes, if that were the case would I be able to access the database when someone else creates the connection string for me?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:PetMime
ID: 9722557
Thanks ThoseBug.  Your procedure worked great for creating a connection string.  I can use this to create my connection now instead of having a coworker do it.

Any idea, though, of why that button doesn't work?  It just seems strange...
0
 
LVL 3

Expert Comment

by:ThoseBug
ID: 9727709
sorry..i was bussy...if i can see your code behind your button may be try to explain why..

regards.
0
 

Author Comment

by:PetMime
ID: 9731411
I think you misunderstood what I was asking...

The button I made (which you helped me with) works fine.  I was simply wondering why the "Build" button in the ADO Connection String Dialog box isn't working.  When I click it nothing happens.  I get no dialog box, no hourglass, nothing.  It's like I've clicked an inactive button.  I don't have any code bedind it since it's part of Delphi.  
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month15 days, 5 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question