Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Databases > SQL won't work
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 24 Topic 944 of 986
Post > Topic >>

SQL won't work

by Greg Gailer <g_gailer@[EMAIL PROTECTED] > Oct 26, 2006 at 04:44 PM

Greetings all,
I have a MySQL database running on a Linux server and wanting to access 
it from Windows. I have the database connection all working correctly. I 
am using the tables and the query from the BDE components and can edit 
the database perfectly through the tables but am having no success in 
the code for the query. The query component has a basic query that works 
well in the component itself.

	select * from Service
	order by CustNum,Invoice;

In code, I execute another query to isolate just one person as follows:

	with Query do begin
	  if Active then Close;
	  if Prepared then Unprepare;
	  SQL.Clear;
	  SQL.Add('select * from Service');
	  SQL.Add('where CustNum=9');
	  SQL.Add('order by Invoice;');
	  Prepare;
	  Open;
		      end;

I was hoping to get all the records for customer number 9 from this 
query but I get the records of all customers ordered as before. This 
seems to suggest that the query is not working at all. I have used this 
sort of query before for local DBase files with no problems. What am I 
doing wrong now? Can anyone please help?
Greg
g_gailer@[EMAIL PROTECTED]

 




 24 Posts in Topic:
SQL won't work
Greg Gailer <g_gailer@  2006-10-26 16:44:52 
Re: SQL won't work
Dodgy <Dodgy@[EMAIL PR  2006-10-26 09:45:53 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-10-26 19:56:48 
Re: SQL won't work
"pr" <pr@[EM  2006-10-26 12:34:08 
Re: SQL won't work
Dodgy <Dodgy@[EMAIL PR  2006-10-26 14:10:29 
Re: SQL won't work
Dodgy <Dodgy@[EMAIL PR  2006-10-26 14:09:18 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-10-27 13:13:50 
Re: SQL won't work
Dodgy <Dodgy@[EMAIL PR  2006-10-31 10:58:18 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-11-02 22:07:13 
Re: SQL won't work
"pr" <pr@[EM  2006-11-02 15:19:14 
Re: SQL won't work
"Ray Porter" &l  2006-11-02 22:40:54 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-11-03 16:54:21 
Re: SQL won't work
Dan <Doculus at CMDCs  2006-10-26 18:56:24 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-10-27 13:06:05 
Re: SQL won't work
"pr" <pr@[EM  2006-10-27 14:56:14 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-10-28 09:49:20 
Re: SQL won't work
Dan <Doculus at CMDCs  2006-10-29 09:21:15 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-11-02 22:10:46 
Re: SQL won't work
"Philip" <re  2006-11-02 15:08:46 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-11-03 16:13:22 
Re: SQL won't work
"Philip" <re  2006-11-03 07:22:22 
Re: SQL won't work
"Philip" <re  2006-11-03 07:23:43 
Re: SQL won't work
Greg Gailer <g_gailer@  2006-11-04 11:58:40 
Re: SQL won't work
"Ray Porter" &l  2006-11-05 08:30:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 0:40:11 CDT 2008.