• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

I need to edit my adoconnection, how?

I know there is a way to edit my adoconnection, but I forgot. I need this help,
0
hidrau
Asked:
hidrau
  • 3
  • 2
1 Solution
 
FarajLYCommented:
uses
ComObj

procedure TForm1.Button1Click(Sender: TObject);
var
  objWord : OleVariant;
  objDoc,objSelection: Variant;
begin
    objWord := CreateOleObject('Word.Application');
    objWord.Visible := True ;
    objDoc := objWord.Documents.Add() ;
     objSelection := objWord.Selection ;
objSelection.Font.Name := 'Arial' ;
objSelection.Font.Size := '18'     ;
objSelection.TypeText(' I know there is a way to edit my adoconnection, but I forgot. I need this help,') ;
objSelection.TypeText(char(#13));
objSelection.Font.Size := '10' ;
objSelection.TypeText( datetostr(Date()) );
end;
0
 
auke_tCommented:
uses OleDB, ComObj, ActiveX;

function ADOConnectionString(ParentHandle: THandle; InitialString: WideString;
  out NewString: string): Boolean;
var
  DataInit: IDataInitialize;
  DBPrompt: IDBPromptInitialize;
  DataSource: IUnknown;
  InitStr: PWideChar;
begin
  Result   := False;
  DataInit := CreateComObject(CLSID_DataLinks) as IDataInitialize;
  if InitialString <> '' then
    DataInit.GetDataSource(nil, CLSCTX_INPROC_SERVER, PWideChar(InitialString),
      IUnknown, DataSource);
  DBPrompt := CreateComObject(CLSID_DataLinks) as IDBPromptInitialize;
  if Succeeded(DBPrompt.PromptDataSource(nil, ParentHandle,
    DBPROMPTOPTIONS_PROPERTYSHEET, 0, nil, nil, IUnknown, DataSource)) then
  begin
    InitStr := nil;
    DataInit.GetInitializationString(DataSource, True, InitStr);
    NewString := InitStr;
    Result    := True;
  end;
end;
0
 
FarajLYCommented:
dear  hidrau
sorry This not for you
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
hidrauAuthor Commented:
No, I need to open my adoconnection as I do when I click in connectionstring
0
 
hidrauAuthor Commented:
ok FarajLY
0
 
hidrauAuthor Commented:
Ok auke_t
Thanks


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now