Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
spedicini
 
Posts: n/a
Default SQL command in DATABASE field

Okay, I've been trying to use the "Insert Database" command in Microsoft Word
2003. Both my Word 2003 and Windows XP are completely updated and patched to
the latest builds.

I want to insert the database as a 'field'. All this works successfully, if
I hit Alt-F9, I can see the table being inserted correctly. However, if I use
the Query Options..., and attempt to do *any* filtering, then I get the error
message,

"The operation cannot be completed because of dialog or database engine
failures. Please try again later."

However, if I then edit the FIELD manually, and remove the 'WHERE' part of
the sql command, then hit F9 to update the field, it works again. In
addition, I *can* use the Query Options Filtering, if I Insert the data
straight into my document, ie, not as a field. So I know that my sql command
is not the problem. I have tried this same procedure on two different
machines with the same results. What is going on?

I've tried to get this to work with a MDB(Access Database) as well as an
Excel table, all it really contains is column headers and the fields below
them. I've also tried different database protocols by turning on the "Confirm
conversion after opening", including OLE DB Database Files, DDE and ODBC. All
of them have the same effect, I can insert the Database as a field, and it
will work fine, as long as I don't use a 'WHERE' sql command.

Here is the field code that is causing the problem:

{ DATABASE \d "mydatabase.mdb" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data
Source=mydatabase.mdb;Mode=Read;Extended Properties=\"\";Jet OLEDB:System
database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDBatabase
Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDBatabase Locking Mode=0;Jet
OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet
OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet
OLEDB:Encrypt Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False" \s "SELECT
'CustomerID', 'Item', 'Price' FROM 'PurchaseTable' WHERE (('CustomerID' =
'1'))" \h }

If I delete
WHERE (('CustomerID' = '1'))
then it will work. I've tried all sorts of WHERE sql comparisons, and all of
them cause the same problems. I've also tried removing the extra paranthesis,
moving them around, etc., all to no avail.

Any help or suggestions at all are most appreciated.

Thanks,
Shaun

 
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
Insert source texts into multiple files and update automatically robfer Microsoft Word Help 9 September 12th 07 10:10 PM
How do I put a picture in a Mail Merge database field. Ring Mailmerge 3 March 16th 05 08:34 AM
Home Phone field not getting picked up in Merge Cathleen McGuire Mailmerge 4 January 7th 05 03:13 AM
User-defined table format using Database field code Papy2000 Mailmerge 1 December 19th 04 10:38 AM
Text Form Field Ref in Footer Won't Update on Screen StarWine Microsoft Word Help 3 December 6th 04 06:17 PM


All times are GMT +1. The time now is 08:56 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"