Database

Delete a User from adatabase in Sql Server 2000

Delete a User from adatabase in Sql Server 2000 procedure TForm1.Button1Click(Sender: TObject); begin ADOCommand1.CommandText := ‘Use DataBaseName’; ADOCommand1.Execute; ADOCommand1.CommandText := ‘Exec SP_DropUser ‘ + QuotedStr(‘Username’); ADOCommand1.Execute; end;

Database

Add a user into a database in Sql Server 2000

Add a user into a database in Sql Server 2000 procedure TForm1.Button1Click(Sender: TObject); begin ADOCommand1.CommandText := ‘Use DataBaseName’; ADOCommand1.Execute; ADOCommand1.CommandText := ‘Exec SP_AddUser ‘ + QuotedStr(‘Username’); ADOCommand1.Execute; end;

Database

Connect To Sql Server 2000

Connect To Sql Server 2000 procedure TForm1.Button1Click(Sender: TObject); begin ADOConnection1.ConnectionString := ‘Server=Hostname;DataBase=DatabaseName’; ADOConnection1.Open(‘UserName’, ‘Password’); ADOConnection1.Connected := True; end; {* For Any Information Mail Me * Mail : Mostafa@Touska.Co.ir0

Database

Add a User’s Login in Sql Server 2000

Add a User’s Login in Sql Server 2000 procedure TForm1.Button1Click(Sender: TObject); begin ADOConnection1.Connected := True; ADOCommand1.CommandText := ‘Exec SP_AddLogin ‘ + QuotedStr(‘UserName’) + ‘,’ + QuotedStr(‘Password’) + ‘,’ + QuotedStr(‘Database Name’) + ‘,’ + QuotedStr(‘English’) […]

Database

Adapt DateTime values for SQL-Server or Access formats

{——————————————————————— Dieser Tip ist als Verbesserung zum ursprünglichen Artikel http://www.swissdelphicenter.ch/de/showcode.php?id=1423 gedacht. Die folgende Funktionen wandeln einen DateTime Wert (unabhنngig vom eingestelltem Datumsformat) in einen für den SQL-Server verstنndlichen String um. ———————————————————————- Please also take a […]

Database

Scroll within a DBGrid

Here is tip how to scroll DBGrid private OldGridProc: TWndMethod; procedure GridWindowProc(var Message: TMessage); //… procedure TForm1.FormCreate(Sender: TObject); begin OldGridProc := DBGrid1.WindowProc; DBGrid1.WindowProc := GridWindowProc; end; procedure TForm1.GridWindowProc(var Message: TMessage); var Pos: SmallInt; begin OldGridProc(Message); […]

Database

Make a HTML and TXT report component

Make a HTML and TXT report component unit LittleReport; interface uses Windows, Messages, SysUtils, Classes, DB, Graphics; const FAuthor = ‘Simone Di Cicco’; FVersion = ‘1.0’; type TLittleReport = class(TComponent) protected FDataSet: TDataSet; FWidth: Integer; […]

Database

Create a Dataset lookup field at runtime

example: create lookup field (string, size: 50) at runtime with TStringField.Create(YourDataSet) do begin FieldName := ‘FieldName’; FieldKind := fkLookup; DataSet := YourDataSet; Name := DataSet.Name + FieldName; KeyFields := ‘YourKeyFields’; LookupDataSet := YourLookupDataSet; LookupKeyFields := […]

Database

Add a Row Number in your DBGrid

1. create new blank field in dbgrid 2. rename the title with ‘No’ 3. put this code in OnDrawColumncell 4. Now your Grid has a row number procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; […]

Database

Create an Access Database (2)

Create an Access Database (2) uses ComObj; procedure TForm1.Button1Click(Sender: TObject); var AccessApp: Variant; begin AccessApp := CreateOleObject(‘Access.Application’); AccessApp.NewCurrentDatabase(‘c:\111.mdb’); AccessApp := Unassigned; end;

Database

Color a specific (conditional) cell in a DBGrid

Color a specific (conditional) cell in a DBGrid procedure TFRM_Main.DBG_MainGetCellParams(Sender: TObject; Field: TField; AFont: TFont; var Background: TColor; Highlight: Boolean); begin if (Field.AsString = ‘0’) and (Field.FullName = ‘LoadingAttn’) then begin Background := $00E69B00; AFont.Color […]

Android

Android – Push Notification

  A notification is a message you can display to the user outside of your application’s normal UI. You can create your own notifications in android very easily. Android provides NotificationManager class for this purpose. In order […]

Android

Android – RenderScript

In this chapter, we will learn about Android RenderScript. Usually the apps on android are designed as to consume as minimum resources as possible. But some applications like some 3D games need high level processing […]

Android

Android – RSS Reader

RSS stands for Really Simple Syndication. RSS is an easy way to share your website updates and content with your users so that users might not have to visit your site daily for any kind […]

Android

Android – Screen Cast

Android Screen cast is a desktop application to control an android device remotely. If your phone is not rooted, you can only view your mobile activity in PC. But if you phone is rooted , […]

Android

Android – SDK Manager

To download and install latest android APIs and development tools from the internet, android provide us with android SDK manager. Android SDK Manager separates the APIs, tools and different platforms into different packages which you […]

Android

Android – Sensors

Most of the android devices have built-in sensors that measure motion, orientation, and various environmental condition. The android platform supports three broad categories of sensors. Motion Sensors Environmental sensors Position sensors Some of the sensors […]

Android

Android – SIP Protocol

SIP stands for (Session Initiation Protocol). It is a protocol that let applications easily set up outgoing and incoming voice calls, without having to manage sessions, transport-level communication, or audio record or playback directly. Applications […]

Android

Android – Spelling Checker

The Android platform offers a spelling checker framework that lets you implement and access spell checking in your application. In order to use spelling checker , you need to implement SpellCheckerSessionListener interface and override its methods. Its […]

Android

Android – SQLite Database

SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to […]

Android

Android – Testing

The Android framework includes an integrated testing framework that helps you test all aspects of your application and the SDK tools include tools for setting up and running test applications. Whether you are working in […]

Android

Android – Text To Speech

Android allows you convert your text into voice. Not only you can convert it but it also allows you to speak text in variety of different languages. Android provides TextToSpeech class for this purpose. In order to […]