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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

D7, D5 Tquery different behaviour?

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi All

Wrote a simple app in D7 using 1 TQuery component. When doing the qry.Open, I expected Delphi 7 to prompt me for username and password but it didn't. I get the message 'General SQL error. Alias: odbc_wotever etc'. I've double check all the obvious things, setting databasename and making sure the alias name is right.

I was perplexed so I literally copied and pasted all the code and controls in to a new app in Delphi 5 and it worked as I expected (login prompt) - then the query opened.

Why does Delphi 7 not prompt me and Delphi 5 does? Do I need to set something somewhere? Also tried it with a TDatabase but still couldn't get it to work. I'm new to D7 and not too good with ADO yet so decided to do it the old BDE way as it's only a quick fix app.

many thanks
lou

 
Lou are you using a database object? I had some similar behaviour in D6.
If during Design time the connected property is set to true and you compile it, sometimes it will not ask for a login prompt. The way I fixed it, setting the connected property to false, make a login from, and activate the database. That way all queries and tables will use the username and password supplied to the database

Steven van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top