Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Mailmerge - Opendatasource syntax
Message
De
14/03/2005 15:33:41
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
00995570
Message ID:
00995679
Vues:
13
I am pretty sure if it's due to the connection string length.

I have tried removing some of the blank options and the error goes away, but I then get a window asking me to confirm the data source. How would I get rid of this dialog programatically as this must be done without any user intervention.

Thanks.

>Frank,
>
>1. Are you sure, it is because of the connection string length?
>2. Try to remove those options that are empty, like:
> [Jet OLEDB:Database Password="""";]. As a rule there are default settings for options.
>
>
>>Hi Yuri,
>>
>>thanks for the help.
>>
>>Unfortunately I don't seem tobe able to get away from the Error: 1429: OLE IDispatch exception code 0 from Microsoft Word: String is longer than 255 characters.
>>
>>I tried splitting the string up like this:
>>
>>.OpenDataSource(m._QueriesText,0, ;
>> .F., .F., .T., .F., "", "", .F., "", "", ;
>> [Provider=Microsoft.Jet.OLEDB.4.0;];
>> + [Password="""";User ID=Admin;Data Source=] + m._Dir_Net + [;];
>> + [Mode=Read;Extended Properties="""";];
>> + [Jet OLEDB:System database="""";];
>> + [Jet OLEDB:Registry Path="""";];
>> + [Jet OLEDB:Database Password="""";];
>> + [Jet OLEDB:Engine Type=18],;
>> "SELECT * FROM '" + JUSTFNAME(m._QueriesText) + "'", "")
>>
>>but still get the error. Have you got any suggestions?
>>
>>Thanks again,
>>
>>
>>>Try to follow the syntax for OpenDataSource method. See VBA help for your MS WOrd version:
>>>
>>>In MS WORD 2002 it is:
>>>expression.OpenDataSource(Name, Format, ConfirmConversions, ReadOnly, LinkToSource, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Connection, SQLStatement, SQLStatement1, OpenExclusive)
>>>
>>>If following the above, the statement looks like:
>>>
>>> .OpenDataSource("C:\Development\VFP8\SigmaSoft\DMSys 5.0\test.DBF",
>>>  wdOpenFormatAuto,.f.,.f.,.t.,;
>>>  .f., "","",.f.,"","", ;
>>>  [Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\Development\VFP8\SigmaSoft\DMSys 5.0;Mode=Read;Extended Properties="""";]+;
>>> [Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=18],;
>>>					"SELECT * FROM `test`","")
>>>
>>>
>>>The particular option may have the string that is too long; then separate pieces similar as above for connection.
>>>
>>>
>>>
>>>>Hi,
>>>>
>>>>I need some help translating some VBA to open a Foxplus type datasource for a mail merge in WOrd. Here's the code from the macro I recorded:
>>>>
>>>> ActiveDocument.MailMerge.OpenDataSource Name:= _
>>>> "C:\Development\VFP8\SigmaSoft\DMSys 5.0\test.DBF", ConfirmConversions:= _
>>>> False, ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
>>>> PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
>>>> WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
>>>> Connection:= _
>>>> "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\Development\VFP8\SigmaSoft\DMSys 5.0;Mode=Read;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=18" _
>>>> , SQLStatement:="SELECT * FROM `test`", SQLStatement1:="", SubType:= _
>>>> wdMergeSubTypeAccess
>>>>
>>>>Can anyone help me sort this out?
>>>>
>>>>Thanks,
>>>>
>>>>Frank.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform