I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi Single User Apps Topic   Print This     

SQL with Access and Delphi 6.0

SQL with Access and Delphi 6.0 in Delphi Single User Apps topic (part of our Pascal and Delphi Coding group).

Quick Search: SQL Access   SQL Access Delphi   6 0  
Francisco Vazquez
 (Inactive)
Mexico
Hi everyone, I hope someone could help me solve this problem out, cause I'm stuck with this since a few days... I have this little script:

procedure TForm1.Button1Click(Sender: TObject);
var
sBusca:string;

begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
sBusca := Edit1.Text;
ADOQuery1.sql.add('Select * from cobranza where nombre = '+QuotedStr(sBusca));
ADOQuery1.Open;
end;

end.

I'm trying to search for a Name into table Cobranza, the problem is that when I compile the script, it runs, but when I push the button it does nothing... so, if I get no error how can I know what's wrong?

I wish someone could throw a lite into my darkness. Oh, one thing, originally I was trying to use 'Select * from Cobranza where nombre LIKE "%cBusca%" ';
in order to find names that have some likeness with the search, but it doesn't work either...

Thanks in advance.
Francisco V.
 Posted 14 years ago (Thread Starter)
Comment Quote
About Francisco Vazquez -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #11126, 1 replies
Thread Started 6/14/2005 4:19:00 PM
View Counter=2755
Last Reply Posted 6/3/2007 7:57:14 PM)
Location=Mexico  
Joined=14 years ago   MB Posts=1   KB Comments=1  
Most Recent Post
Wes Peterson
Prestwood IT
Prestwood IT office in Citrus Heights, CA

Francisco,

I apologize for the tardy reply.

I think the QuotedStr function is causing your problem.  Try just single quotes around your search string.

Wes 

Wes Peterson
Senior Software Engineer
Prestwood IT Solutions
http://www.prestwood.com

 Posted 12 years ago
Comment Quote
About Wes Peterson -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Wes Peterson

Wes Peterson is a Senior Programmer Analyst with Prestwood IT Solutions where he develops custom Windows software and custom websites using .Net and Delphi. When Wes is not coding for clients, he participates in this online community. Prior to his 10-year love-affair with Delphi, he worked with several other tools and databases. Currently he specializes in VS.Net using C# and VB.Net. To Wes, the .NET revolution is as exciting as the birth of Delphi.


Post ID #11736 (Level 1.1)  Reply to 11126
Thread Started 6/3/2007 7:57:14 PM
View Counter=2
Location=Prestwood IT office in Citrus Heights, CA 
Joined=15 years ago   MB Posts=158   KB Posts=163   KB Comments=34   BLOG, Topics=20  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1186A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #11126 Counter
2755
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech