Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-02-2006, 02:32 AM   #1 (permalink)
Rowin
Registered User
 
Join Date: Apr 2006
Posts: 9
Rowin is on a distinguished road
C++ Builder 6 - Database Search

Hi,

I have a table called event in my database.
I have 2 fields called Event_Id and Project_Id.
I want to search the table to find out if there's event_id=27 for a project_id.


Kind Regards,
Rowin
Rowin is offline   Reply With Quote
Old 05-02-2006, 03:57 PM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Does it use SQL?
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 05-03-2006, 12:49 AM   #3 (permalink)
Rowin
Registered User
 
Join Date: Apr 2006
Posts: 9
Rowin is on a distinguished road
Yes I'm using SQL.


kind Regards,
Rowin
Rowin is offline   Reply With Quote
Old 05-03-2006, 06:01 AM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Code:
SELECT Project_id, Event_id FROM event WHERE Event_id = 27 AND Project_id = <your_project_id>;
Just replace <your_project_id> with whatever project id variable you have. Note that while SQL commands (select,where, from) are case insensititve, table names and fields are case sensitive.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 05-03-2006, 07:09 AM   #5 (permalink)
Rowin
Registered User
 
Join Date: Apr 2006
Posts: 9
Rowin is on a distinguished road
I need to write the code in my C++ Builder 6 application.
How to insert the SQl in C++?

Kind Regards,
Rowin
Rowin is offline   Reply With Quote
Old 05-04-2006, 04:46 AM   #6 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 672
DJMaze is on a distinguished road
Start -> Search -> find: bcb6.hlp

You should find info about TQuery inside that help
DJMaze is offline   Reply With Quote
Old 05-04-2006, 05:03 AM   #7 (permalink)
Rowin
Registered User
 
Join Date: Apr 2006
Posts: 9
Rowin is on a distinguished road
Thanks.

Kind regards,
Rowin
Rowin is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a search engine for your website with PHP zhisede PHP 3 10-25-2005 07:54 AM
EnterpriseDB 2005 Wins Best Database Award at LinuxWorld technobard Code Newbie News 2 09-06-2005 07:41 PM
Search function with its own database Sonny1973 HTML, XML, Javascript, AJAX 3 03-28-2005 03:52 PM
Search -That Can Match Out Of Order Items JBurke All Other Coding Languages 11 09-25-2003 02:09 PM


All times are GMT -8. The time now is 02:39 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting