InsertDatabase behaviour in Word 2003 VBA

J

John Gedling

The following code retrieves data from an ODBC system DSN :

.Range.InsertDatabase _
Format:=formatparam, Style:=styleparam, _
LinkToSource:=False, Connection:=constr, _
SqlStatement:=sql1, SqlStatement1:=sql2, _
IncludeFields:=tblfmt

constr = "DSN=xxx;SERVERTYPE=INGRES;BLANKDATE=NULL"

In Word 2000 and XP this works ok, in Word 2003 it brings
up the Select Data Source dialog and the user has to
select +Connect to New Data Source.odc and hit "Open".

How can I prevent this dialog appearing ?

Thanks
John
 
W

Word Heretic

G'day "John Gedling" <[email protected]>,

Just a wild guess

you could try setting Application.DisplayAlerts = wdAlertsNone just
before.


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


John Gedling reckoned:
 
J

John Gedling

Steve,

Nice idea but unfortunately has no effect.
Surely there must be (should be...) some way to retrieve
data from a DSN without seeing this redundant dialog...

Thanks
John
 
W

Word Heretic

G'day "John Gedling" <[email protected]>,

Possibly - I have had limited scope when playing with 2003 so far :)


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


John Gedling reckoned:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top