?
Solved

Database

Posted on 2004-03-31
6
Medium Priority
?
175 Views
Last Modified: 2010-04-05
I have a SQL query connected to a data source and to a database component on a form.
I have turned the login prompt to false on the database component so I dont receive a login box when I activate the query.

My problem is that I still receive a login box even though I have carried out the above. Am i missing something?

I am using Delphi 5 Professional and the query is performing a select on a SQL Server system.

Any suggestions would be great.
Thanks
Sct
0
Comment
Question by:SCOTT78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10723666
is your query bound to the tdatabase?
(property databasename -> select here the name of the tdatabase)

meikl ;-)
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 120 total points
ID: 10723693
Thats because your database requires a login, even though you shut it off, by telling the LoginPrompt = false


Try passing the login info using the Params property of the database.

You can set it at design time,

or

runtime

here is an example:

{------------------------------------------------------------------------------}
function TAdmin_DataModule.Connect_Database(aServer, aUserName,
aPassword : string; aDatabase : TDatabase) : Boolean;
var
 TmpStrList : TStringList;
begin
 TmpStrList := nil;
 Result := True;
   try
    TmpStrList := TStringList.Create;
    TmpStrList.Add('SERVER NAME=' + aServer);
    TmpStrList.Add('USER NAME=' + aUserName);
    TmpStrList.Add('PASSWORD=' + '');
    aDatabase.Params.Assign(TmpStrList);
   finally
    try
     aDatabase.Connected := True;
     Result := aDatabase.Connected;
     TmpStrList.Free;
    except
     Result := False;
     aDatabase.Connected := False;
     TmpStrList.Free;
    end; {try except}
   end;

end;
0
 
LVL 11

Expert Comment

by:calinutz
ID: 10727489
You probabely placed the Database component on a form ... and not on a DataModule and you probabely placed another query component on another form. You should place all the data acces components (query, table, database, datasources) in a DataModule and try to see if you get the login prompt.
 Cheers.
0
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.

 
LVL 11

Expert Comment

by:calinutz
ID: 10727501
And of course you must obviously link the form that uses the query with the data module.

Calinutz
0
 

Expert Comment

by:meadorj
ID: 10736061
Also if your dbms requires a uname and password then you will have to set those properties for the database.  I think you can set them at design time but I know you can set them at run time like was poseted above.
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10740293
SCOTT78, yoy might want to try being a liitle more hospitable with your grading.

If you didn't get the answer you wanted, hold off until you get it. ( question = 1 day old)

Experts may not answer your questions if you are gonna grade in the fashion you do.

Shane
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

800 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