ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

دلفی و اس کیو ال (جستجو کردن )

 
Post new topic   Reply to topic    ParsX.com Forum Index -> راهنمايي در پروژه
View previous topic :: View next topic  
Author Message
parnian
دوست آشناي سايت


Joined: 29 Jul 2006
Posts: 72

PostPosted: Sat Aug 30, 2008 6:13 pm    Post subject: دلفی و اس کیو ال (جستجو کردن ) Reply with quote

با سلام
یک پروزه به زبان دلفی داشتم که باید از بانک اطلاعاتی اس کیو ال استفاده کنه عمل درج و ... را نوشتم ولی نمی دونم چه دستوراتی باید در stored procedure بنویسم تا عمل [size=18]جستجو[/size] انجام بشه لطفا کمک کنید و به صورت کامل هم توضیح بدین (تو اینترنت سرچ کردم چیز جالبی بدست نیاوردم ) ( لطفا آدرس سایت ندین )
باتشکر
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Sun Aug 31, 2008 7:56 am    Post subject: Reply with quote

خوب اگه نتوني از اينترنت اين چيز ها رو پيدا كني . هميشه محتاج فروم ها مي موني و كارت لنگ مي مونه :
يه ODBC از كنترلت اضافه كن كه به Sql وصل بشه . بعد كد زير رو اضافه كن :

procedure TForm1.Button1Click(Sender: TObject);
var
  RecordSet: OleVariant;
  temp: string;
  DSN: string;
  SelectString : string;
  i : integer;
begin

  // ODBC dsn from ACESS database….
  DSN := 'dsn=AdoTest';

  // the SQL string…
  SelectString := 'SELECT * FROM clientes';

  // Create an empty recordset object
  RecordSet := CreateOleObject('ADODB.Recordset');

  // Fill the recordset
  RecordSet.Open(SELECTSTRING, DSN);

  // Display the data
  repeat
     // the client table has four fields
     // this loop will put one record per line in the memo
     for i:= 0 to 3 do
       temp := temp + ' ' + RecordSet.Fields[i].Value;
     Memo1.Lines.Add(temp);
     RecordSet.MoveNext;
     temp := '';
  until RecordSet.EOF;

end;
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Sun Aug 31, 2008 8:00 am    Post subject: Reply with quote

نيازي به store procedure هم نداري فقط كافيه دستور SQL رو برايش يه شرط بزاري where field1=textbox.txt كه textbox اطلاعاتش رو از كاربر مي گيره .
Back to top
parnian
دوست آشناي سايت


Joined: 29 Jul 2006
Posts: 72

PostPosted: Sat Sep 06, 2008 11:55 am    Post subject: Reply with quote

بازم سلام
راستشو بخواین من تازه کار دلفی هستم با دلفی 6 هم کار می کنم آیا این قطعه کد با دلفی 6 هم کار می کنه ؟؟؟؟؟؟؟؟؟ و اینکه خود شی recordset رو از کدوم تب دردلفی6 باید بیارم ؟؟؟؟؟؟؟؟؟ (لطفا کامل توضیح بدید) منتظرم
با تشکر
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> راهنمايي در پروژه All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum