We help IT Professionals succeed at work.

I need to edit my adoconnection, how?

hidrau
hidrau asked
on
Medium Priority
323 Views
Last Modified: 2010-08-05
I know there is a way to edit my adoconnection, but I forgot. I need this help,
Comment
Watch Question

Commented:
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;
CERTIFIED EXPERT
Commented:
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;

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
dear  hidrau
sorry This not for you

Author

Commented:
No, I need to open my adoconnection as I do when I click in connectionstring

Author

Commented:
ok FarajLY

Author

Commented:
Ok auke_t
Thanks


Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.