Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
Create or edit an OLE-DB connect string during runtime. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
An easy way to edit or create OLE-DB connect strings 13-May-04
Category
ADO/OLE-DB
Language
CBuilder 4.x
Views
620
User Rating
7.75
# Votes
4
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   /*I always wanted to find a way to edit or create an OLE-DB connect string during 
3   runtime, instead of doing it the old way by stopping an application and setting the 
4   connect string during design time and restarting the application again. Well I have 
5   found a way in doing so here is the source codes below to edit or create an OLE-DB 
6   connect string.*/
7   
8   //---------------------------------------------------------------------------
9   #include <vcl.h>
10  #pragma hdrstop
11  
12  #include "Unit1.h"
13  //---------------------------------------------------------------------------
14  
15  #pragma package(smart_init)
16  #pragma resource "*.dfm"
17  TForm1 *Form1;
18  //---------------------------------------------------------------------------
19  __fastcall TForm1::TForm1(TComponent* Owner)
20          : TForm(Owner)
21  {
22  }
23  //---------------------------------------------------------------------------
24  
25  void __fastcall TForm1::Button1Click(TObject *Sender)
26  {
27  adoCon->Connected=false;
28  adoCon->ConnectionString =  PromptDataSource((unsigned int) Handle, 
29  edtConnection->Text);
30  
31  adoCon->Connected=true;
32  }
33  /*once the button is pressed it will bring up the Datalink form and from there you
34  can create or edit a ole-db connection string. once you have finished with the form.
35  the PromptDataSource function will return the connections string.*/
36  
37  //---------------------------------------------------------------------------



			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC