Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi

Status
Not open for further replies.

Webrookie

Programmer
May 18, 2000
112
US
I'm new to Delphi, but I took a semester of it in school a few years ago.&nbsp;&nbsp;I'm trying to pick it up again, but I'm having some problems.&nbsp;&nbsp;I would like to do a simple SQL Server app that simply returns records.<br><br>I am only using components for now, I will mess with large amounts of code later.&nbsp;&nbsp;Currently, I have a Tdblookuplistbox<br>which has it's datasource set to a Tdatasource component.&nbsp;&nbsp;I have the dataset property of the Tdatasource component pointing to a Tquery component.&nbsp;&nbsp;I set up the Tquery component with some SQL and to a proper database.<br><br>That all works fine, but is there a more efficient way to do this?&nbsp;&nbsp;And what is the point of a Tdatabase component?<br>Is there a way to make it so that I don't get a prompt for a username/password to access the database?&nbsp;&nbsp;Maybe by using parameters or something?
 
Dear,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Solution to your problem is simple. just drop a Tdatabase component and set it alias name to that of your alias name pointing to your database file. and set the LoginPrompt property to false and in the params property set UserName=xxx <br>&nbsp;&nbsp;&nbsp;&nbsp;Password=xxx<br>and set the connected property to true and now just point to your query component and set its database name to the name the Tdatabase component and let it run.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;now you can see it won't prompt you for username and password.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Have a fun with delphi.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top