Reply
 
Thread Tools Display Modes
  #1   Report Post  
Don Petersen via OfficeKB.com
 
Posts: n/a
Default OpenDataSource still asks for a table name

I'm updating an application from 2000 to 2003. I've read that 2003 doesn't
use DDE. Upon Microsoft's suggestion in a knowledge article I tried both
SQLStatement:="QUERY Select * From Docs;"
and
Connection:="TABLE [Docs]", _
SubType:=wdMergeSubTypeWord2000
as clauses in my OpenDataSource. Neither had any impact. I was still
prompted for a table name.
Any suggestions?
Thanks

--
Message posted via http://www.officekb.com
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Word 2003 /can/ use DDE but it now uses OLEDB by default.

Assuming you are connecting to Access, for DDE you will probably need:

yourMailMergeObject.OpenDataSource _
Name:="the full pathname of your .mdb", _
Connection:="TABLE Docs", _
SQlStatement:="SELECT * FROM Docs", _
SubType:=wdMergeSubTypeWord2000

In this case you can probably get away with either

yourMailMergeObject.OpenDataSource _
Name:="the full pathname of your .mdb", _
SQlStatement:="SELECT * FROM Docs", _
SubType:=wdMergeSubTypeWord2000

or

yourMailMergeObject.OpenDataSource _
Name:="the full pathname of your .mdb", _
Connection:="TABLE Docs", _
SubType:=wdMergeSubTypeWord2000

As far as I know, you only need the [] around the table name if it contains
characters such as spaces, but it is probably sensible to put them in.

Peter Jamieson

"Don Petersen via OfficeKB.com" wrote in message
...
I'm updating an application from 2000 to 2003. I've read that 2003 doesn't
use DDE. Upon Microsoft's suggestion in a knowledge article I tried both
SQLStatement:="QUERY Select * From Docs;"
and
Connection:="TABLE [Docs]", _
SubType:=wdMergeSubTypeWord2000
as clauses in my OpenDataSource. Neither had any impact. I was still
prompted for a table name.
Any suggestions?
Thanks

--
Message posted via http://www.officekb.com



  #3   Report Post  
Don Petersen via OfficeKB.com
 
Posts: n/a
Default

I would prefer to not use DDE. However, I tried both solutions, as I tried
to indicate in my first post.
This was to accommodate the new linkage:
doc.MailMerge.OpenDataSource _
Name:=Path & "IPdb.mdb", _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
SQLStatement:="QUERY Select * From [Docs];"

and this was to use compatibility mode:
doc.MailMerge.OpenDataSource _
Name:=Path & "IPdb.mdb", _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
Connection:="TABLE [Docs]", _
SubType:=wdMergeSubTypeWord2000

I even tried putting both clauses into compatibility mode:
doc.MailMerge.OpenDataSource _
Name:=Path & "IPdb.mdb", _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
Connection:="TABLE [Docs]", _
SQLStatement:="QUERY Select * From [Docs];", _
SubType:=wdMergeSubTypeWord2000

I'm still getting prompted for a table.

--
Message posted via http://www.officekb.com
  #4   Report Post  
Peter Jamieson
 
Posts: n/a
Default

You (still) need to eliminate the word "QUERY" from your SQLStatement. For
OLEDB,

doc.MailMerge.OpenDataSource _
Name:=Path & "IPdb.mdb", _
SQLStatement:="Select * From [Docs];"

should be enough, and you do need the [] in this case.

Peter Jamieson


"Don Petersen via OfficeKB.com" wrote in message
...
I would prefer to not use DDE. However, I tried both solutions, as I tried
to indicate in my first post.
This was to accommodate the new linkage:
doc.MailMerge.OpenDataSource _
Name:=Path & "IPdb.mdb", _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
SQLStatement:="QUERY Select * From [Docs];"

and this was to use compatibility mode:
doc.MailMerge.OpenDataSource _
Name:=Path & "IPdb.mdb", _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
Connection:="TABLE [Docs]", _
SubType:=wdMergeSubTypeWord2000

I even tried putting both clauses into compatibility mode:
doc.MailMerge.OpenDataSource _
Name:=Path & "IPdb.mdb", _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
Connection:="TABLE [Docs]", _
SQLStatement:="QUERY Select * From [Docs];", _
SubType:=wdMergeSubTypeWord2000

I'm still getting prompted for a table.

--
Message posted via http://www.officekb.com



  #5   Report Post  
Don Petersen via OfficeKB.com
 
Posts: n/a
Default

I've tried about every syntactic variation on the SQLStatement clause. Some
result in a run-time error. Some result in a prompt for a table name. None
result in the datasource being opened and automagically pointing to the
proper table.

--
Message posted via http://www.officekb.com
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table AutoFormats vs. Table Styles confusion Tony Jollans Tables 5 March 6th 05 07:18 PM
Item in Table of Contents throw off numbering Robert McN Page Layout 4 January 27th 05 12:50 AM
Dragging table column resets Sedonakids Tables 0 January 12th 05 01:11 AM
Row height problem with table in table Stephanie T. Tables 0 November 23rd 04 03:35 PM
table caption numbering scottkinsey Tables 1 November 11th 04 11:47 AM


All times are GMT +1. The time now is 11:53 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"