• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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