Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2006

Tip: Looking for answers? Try searching our database.

mala direta com arquivo dbf

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
neia - 23 Mar 2006 17:50 GMT
Tenho um arquivo gerado pelo Visual FoxPro 6.0. Ao tentar criar uma mala
direta  utilizando-o e confirmando a fonte de dados como "arquivos foxpro"
recebo as mensagens: "Unable do load ole32.dll" e "Falha de sqllochandle do
driver sql_handle-env".
Entrei no Painel de controle para tentar configurar o driver mas ele manda a
mesma mensagem "Unable do load ole32.dll" e não me deixa fazer nada.
Peter Jamieson - 26 Mar 2006 20:42 GMT
I am sorry I cannot write Portuguese, but...
...Can you open your FoxPro data source using Excel

Peter Jamieson
> Tenho um arquivo gerado pelo Visual FoxPro 6.0. Ao tentar criar uma mala
> direta  utilizando-o e confirmando a fonte de dados como "arquivos foxpro"
[quoted text clipped - 4 lines]
> a
> mesma mensagem "Unable do load ole32.dll" e não me deixa fazer nada.
neia - 29 Mar 2006 14:35 GMT
Yes. I don´t have problem with excel.
However, I would like use  FoxPro with Word, using mailmerge class.

> I am sorry I cannot write Portuguese, but...
> ....Can you open your FoxPro data source using Excel
[quoted text clipped - 8 lines]
> > a
> > mesma mensagem "Unable do load ole32.dll" e não me deixa fazer nada.
Peter Jamieson - 04 Apr 2006 18:05 GMT
Sorry it has taken a while to get back to you on this.

I do not know what is going wrong where you are, but here the following
things worked, using Word 2003 and
a. the Visual FoxPro ODBC driver called "Microsoft Visual FoxPro Driver"
version 6.01.8629.01 (it also has a Portuguese name, "Driver para o
Microsoft Visual FoxPro")
b. the visual FoxPro OLEDB Provider version

Let's assume you have a folder called c:\fp containing a .dbc called db.dbc
and some .dbf files associated with the .dbc, including one called t.dbf

Then you should be able to connect in the following ways (at least):

Using ODBC to connect
-----------------------------------
Create an ODBC User or System DSN called fox.It doesn't matter whether you
set it up for a DBC or DBFs

For a DBC, use the following OpenDataSource call (sorry, you will need to
fix the line wrapping):

ActiveDocument.MailMerge.OpenDataSource _
 Name:="", _
 Connection:="DSN=fox;UID=;PWD=;SourceDB=C:\fp;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;",
_
 SQLStatement:="SELECT * FROM `t`", _
 SubType:=wdMergeSubTypeWord2000

For a DBF, use the following OpenDataSource call:

ActiveDocument.MailMerge.OpenDataSource _
 Name:="", _
 Connection:="DSN=fox;UID=;PWD=;SourceDB=C:\fp\db.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;",
_
 SQLStatement:="SELECT * FROM `t`", _
 SubType:=wdMergeSubTypeWord2000

Using OLEDB to connect
--------------------------

I am fairly sure that you cannot specify the .dbc or .dbf in the Name
parameter. I think you have to have a .udl or .odc file. These are just
plain text files that are supposed to provide connection details. However,
as far as I know either type of file can be an empty text file that you can
create in Notepad. Let's suppose you have such a file called c:\fp\fox.udl

Then try:

ActiveDocument.MailMerge.OpenDataSource _
   Name:="c:\fp\fox.udl", _
   Connection:="Provider=VFPOLEDB.1;Data Source=c:\fp\db.dbc;Mode=Share
Deny None;User ID="""";Password="""";", _
   SQLStatement:="SELECT * FROM `t`"

or:

ActiveDocument.MailMerge.OpenDataSource _
   Name:="c:\fp\fox.udl", _
   Connection:="Provider=VFPOLEDB.1;Data Source=c:\fp;Mode=Share Deny
None;User ID="""";Password="""";", _
   SQLStatement:="SELECT * FROM `t`"

If you want the user to be able to select the dbf, given a folder or dbc, I
suspect it is possible using a .odc, but ask again. (I will not be back for
a few days).

Peter Jamieson

To connect to a dbf, try

> Yes. I don´t have problem with excel.
> However, I would like use  FoxPro with Word, using mailmerge class.
[quoted text clipped - 15 lines]
>> > a
>> > mesma mensagem "Unable do load ole32.dll" e não me deixa fazer nada.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.