Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Table AutoFormats vs. Table Styles confusion | Tables | |||
Item in Table of Contents throw off numbering | Page Layout | |||
Dragging table column resets | Tables | |||
Row height problem with table in table | Tables | |||
table caption numbering | Tables |