If you want to add value to the Combo Box in Delphi then the point is you add some value in Combo Items ( see ComboBox properties in object inspector)
If You using query to access the database you can write the code like this:
Read all about computer tips, Step by Step Tutorial, Lots of useful and interesting information about computer and Internet. All FREE!
Showing posts with label Programming help. Show all posts
Showing posts with label Programming help. Show all posts
Friday, July 6, 2012
Saturday, January 10, 2009
How to connect Delphi to database SQL Server
Delphi provides several ways to connect to the database SQL Server. One of the connections is using ADODB. The component to create this connection is ADOConnection

How to setting this component? You can try this simple program below:
1. Open your Delphi Program ( in this example I am using Delphi 6)
2. Design the form like the picture below:

Design each object property with following data:
TEdit :
Edit1
TButton:
3. Double Click Button1 and Type source code below:

4. Running the program by pressing F9
5. Click Test Connection Button, you will have prompt message whether the connection Success or fail , see the picture below

Have a nice Try :)
Related Topics:
How to connect Delphi to database SQL Server
Select Distinct, Not In and Right Outer Join in SQL Command
Function Date and Time in Foxpro
How to setting this component? You can try this simple program below:
1. Open your Delphi Program ( in this example I am using Delphi 6)
2. Design the form like the picture below:

Design each object property with following data:
TEdit :
Edit1
- Name : Eservername
- Text: <blank>
- Name: Euser
- Text: <blank>
- Name: Epassword
- Text: <blank>
- PasswordChar:*
- Name: Edbname
- Text: <blank>
TButton:
- Name: Button1
- Caption : Test Connection
- LoginPrompt: False
3. Double Click Button1 and Type source code below:

4. Running the program by pressing F9
5. Click Test Connection Button, you will have prompt message whether the connection Success or fail , see the picture below

Have a nice Try :)
Related Topics:
How to connect Delphi to database SQL Server
Select Distinct, Not In and Right Outer Join in SQL Command
Function Date and Time in Foxpro
Sunday, October 12, 2008
Function Date and Time in Foxpro
Programming
Sometime we still find or using database like foxpro, Just Like today I want to get the data using dababase foxpro using SQL command:
Select * from data1 where tanggal = ‘11/28/2007′ but its not return any record
to get the data result I have to add function ctod before date :
select * from data1 where tanggal = ctod (’11/28/2007′)
When I try that command its working..:)
I write Below Command as your reference
Below is Function Date and Time in Foxpro :
1. Overview Date and Time Functions
For more detail please refer to VFP help files.
Date and Time Functions
CDOW( ) Function
Returns the day-of-the-week from a given Date or DateTime expression.
CMONTH( ) Function
Returns the name of the month from a given date or DateTime expression.
CTOD( ) Function
Converts a character expression to a date expression.
CTOT( ) Function
Returns a DateTime value from a character expression.
DATE( ) Function
Returns the current system date, which is controlled by the operating system.
DATETIME( ) Function
Returns the current date and time as a DateTime value.
DAY( ) Function
Returns the numeric day-of-the-month for a given Date or DateTime expression.
DMY( ) Function
Returns a character expression in day-month-year format (for example, 31 May 1996) from a Date or DateTime expression. The month name isn’t abbreviated.
DOW( ) Function
Returns a numeric day-of-the-week value from a Date or DateTime expression.
DTOC( ) Function
Returns a Character-type date from a Date or DateTime expression.
DTOS( ) Function
Returns a character-string date in a yyyymmdd format from a specified Date or DateTime expression.
DTOT( ) Function
Returns a DateTime value from a Date expression.
FDATE( ) Function
Returns the last modification date for a file.
FTIME( ) Function
Returns the last modification time for a file.
GOMONTH( ) Function
Returns the date that is a specified number of months before or after a given Date or DateTime expression.
HOUR( ) Function
Returns the hour portion from a DateTime expression.
MDY( ) Function
Returns the specified date or datetime expression in month-day-year format with the name of the month spelled out.
MINUTE( ) Function
Returns the minute portion from a DateTime expression.
MONTH( ) Function
Returns the number of the month for a given Date or DateTime expression.
SEC( ) Function
Returns the seconds portion from a DateTime expression.
SECONDS( ) Function
Returns the number of seconds that have elapsed since midnight.
SET HOURS Command
Sets the system clock to a 12- or 24-hour time format.
SET MARK TO Command
Specifies a delimiter for the display of date expressions.
SET SECONDS Command
Specifies whether seconds are displayed in the time portion of a DateTime value.
SYS(1) Function - Julian System Date
Returns the current system date as a Julian day number character string.
SYS(2) Function - Seconds Since Midnight
Returns the number of seconds elapsed since midnight.
SYS(10) Function - String From Day Number
Converts a Julian day number to a character string.
SYS(11) Function - Julian Day Number
Converts a date expression or character string in date format to a Julian day number.
TIME( ) Function
Returns the current system time in 24-hour, eight-character string (hh:mm:ss) format.
TTOC( ) Function
Converts a DateTime expression to a Character value of a specified format.
TTOD( ) Function
Returns a Date value from a DateTime expression.
WEEK( ) Function
Returns a number representing the week-of-the-year from a Date or DateTime expression.
YEAR( ) Function
Returns the year from the specified date or datetime expression.
Related Topics:
How to connect Delphi to database SQL Server
Select Distinct, Not In and Right Outer Join in SQL Command
Function Date and Time in Foxpro
Sometime we still find or using database like foxpro, Just Like today I want to get the data using dababase foxpro using SQL command:
Select * from data1 where tanggal = ‘11/28/2007′ but its not return any record
to get the data result I have to add function ctod before date :
select * from data1 where tanggal = ctod (’11/28/2007′)
When I try that command its working..:)
I write Below Command as your reference
Below is Function Date and Time in Foxpro :
1. Overview Date and Time Functions
For more detail please refer to VFP help files.
Date and Time Functions
CDOW( ) Function
Returns the day-of-the-week from a given Date or DateTime expression.
CMONTH( ) Function
Returns the name of the month from a given date or DateTime expression.
CTOD( ) Function
Converts a character expression to a date expression.
CTOT( ) Function
Returns a DateTime value from a character expression.
DATE( ) Function
Returns the current system date, which is controlled by the operating system.
DATETIME( ) Function
Returns the current date and time as a DateTime value.
DAY( ) Function
Returns the numeric day-of-the-month for a given Date or DateTime expression.
DMY( ) Function
Returns a character expression in day-month-year format (for example, 31 May 1996) from a Date or DateTime expression. The month name isn’t abbreviated.
DOW( ) Function
Returns a numeric day-of-the-week value from a Date or DateTime expression.
DTOC( ) Function
Returns a Character-type date from a Date or DateTime expression.
DTOS( ) Function
Returns a character-string date in a yyyymmdd format from a specified Date or DateTime expression.
DTOT( ) Function
Returns a DateTime value from a Date expression.
FDATE( ) Function
Returns the last modification date for a file.
FTIME( ) Function
Returns the last modification time for a file.
GOMONTH( ) Function
Returns the date that is a specified number of months before or after a given Date or DateTime expression.
HOUR( ) Function
Returns the hour portion from a DateTime expression.
MDY( ) Function
Returns the specified date or datetime expression in month-day-year format with the name of the month spelled out.
MINUTE( ) Function
Returns the minute portion from a DateTime expression.
MONTH( ) Function
Returns the number of the month for a given Date or DateTime expression.
SEC( ) Function
Returns the seconds portion from a DateTime expression.
SECONDS( ) Function
Returns the number of seconds that have elapsed since midnight.
SET HOURS Command
Sets the system clock to a 12- or 24-hour time format.
SET MARK TO Command
Specifies a delimiter for the display of date expressions.
SET SECONDS Command
Specifies whether seconds are displayed in the time portion of a DateTime value.
SYS(1) Function - Julian System Date
Returns the current system date as a Julian day number character string.
SYS(2) Function - Seconds Since Midnight
Returns the number of seconds elapsed since midnight.
SYS(10) Function - String From Day Number
Converts a Julian day number to a character string.
SYS(11) Function - Julian Day Number
Converts a date expression or character string in date format to a Julian day number.
TIME( ) Function
Returns the current system time in 24-hour, eight-character string (hh:mm:ss) format.
TTOC( ) Function
Converts a DateTime expression to a Character value of a specified format.
TTOD( ) Function
Returns a Date value from a DateTime expression.
WEEK( ) Function
Returns a number representing the week-of-the-year from a Date or DateTime expression.
YEAR( ) Function
Returns the year from the specified date or datetime expression.
Related Topics:
How to connect Delphi to database SQL Server
Select Distinct, Not In and Right Outer Join in SQL Command
Function Date and Time in Foxpro
Select Distinct, Not In and Right Outer Join in SQL Command
Programming
Hi, Today management asked me to get quick data absent every day for the employee who did not enter or his data did not enter the absent machine, then I tried to modify the program absent that I created and put the SQL command as follows:
Ex :
Table1
Table2
To get the result use this SQL command below:
SELECT DISTINCT (dbo. Table2.kode), dbo. Table1.kode, dbo. Table1.nama, dbo. Table1.department FROM dbo. Table2 RIGHT OUTER JOIN dbo. Table1 ON dbo. Table2.kode = dbo. Table1.kode'Where dbo. Table1.kode NOT IN (select dbo. Table2.kode from dbo.Table2 WHERE tanggal = ‘09/15/2008) and dbo. Table1.department = ‘Finance’
Related Topics:
How to connect Delphi to database SQL Server
Select Distinct, Not In and Right Outer Join in SQL Command
How To Import Data Excel To SQL Server 2005
Function Date and Time in Foxpro
Hi, Today management asked me to get quick data absent every day for the employee who did not enter or his data did not enter the absent machine, then I tried to modify the program absent that I created and put the SQL command as follows:
Ex :
Table1
Id_number | name | Department |
A0001 | David | Finance |
A0002 | Rahul | Finance |
A0003 | Robert | Finance |
B0001 | Diana | Finance |
B0002 | Fabio | Finance |
B0003 | Budi | Finance |
Id_number | Date |
A0001 | 09/14/2008 |
A0002 | 09/14/2008 |
A0003 | 09/15/2008 |
B0001 | 09/15/2008 |
B0002 | 09/15/2008 |
B0003 | 09/15/2008 |
SELECT DISTINCT (dbo. Table2.kode), dbo. Table1.kode, dbo. Table1.nama, dbo. Table1.department FROM dbo. Table2 RIGHT OUTER JOIN dbo. Table1 ON dbo. Table2.kode = dbo. Table1.kode'Where dbo. Table1.kode NOT IN (select dbo. Table2.kode from dbo.Table2 WHERE tanggal = ‘09/15/2008) and dbo. Table1.department = ‘Finance’
Related Topics:
How to connect Delphi to database SQL Server
Select Distinct, Not In and Right Outer Join in SQL Command
How To Import Data Excel To SQL Server 2005
Function Date and Time in Foxpro
Subscribe to:
Posts (Atom)