Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: DoCmd.TransferDatabase

Geek News

DoCmd.TransferDatabase
ooxx 11/7/2008 9:30:05 AM
Hi,

Hi holey.. excuse me.

My question is :
I want to import file type .DBF by using VBA code. Can any body show me
some examples?

Thanks,

Re: DoCmd.TransferDatabase
"Klatuu" <david.hargis[ at ]realpage.com> 11/7/2008 3:16:46 PM
We need a lot more information. You can't import an entire Access database
into the current database in one operation. Please provide some detail on
exactly WHAT you want to do. Then we can offer some suggestions on how.

"ooxx" <ooxx[ at ]discussions.microsoft.com> wrote in message
news:7FF7BE0C-2662-4D21-A44E-3EEE891BCA63[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> Hi holey.. excuse me.
>
> My question is :
> I want to import file type .DBF by using VBA code. Can any body show me
> some examples?
>
> Thanks,
>


Re: DoCmd.TransferDatabase
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 11/7/2008 3:17:58 PM
DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName, ObjectType,
Source, Destination, StructureOnly, StoreLogin)is taken from the VB help
file.

You would replace DataBase Type with "dBase III ", "dBase IV ", "dBase 5.0"

*IF* the .DBF file is in one of those formats. If not you might have to use
TransferText

Yours would look like
DoCmd.TransferDatabase acImport, "dBase III", _
"C:\MyDataBase.DBF", acReport, "NW Sales for April", _
"Corporate Sales for April"

ooxx wrote:
[Quoted Text]
> Hi,
>
> Hi holey.. excuse me.
>
> My question is :
> I want to import file type .DBF by using VBA code. Can any body show
> me some examples?
>
> Thanks,


Re: DoCmd.TransferDatabase
ooxx 11/10/2008 4:03:00 AM
Hi ,

Okey, as soon as I have tried the code you provided, Mike, it seems that it
would work, but the code is unlike the the type of Ms Access database that it
should point to the table or the "Table Name". Yes, DBF has no TableName. I
have tried one in DBF type but not success.

Another problem of me is when running the code in the type of Ms Access
database the root to the DbName, the code know where to extract. On the same
occassion, I do it on the DBF type, when running the code, it cann't, and
shown up the message "c:/Ex.DBF is not a valid path", eventhough, I have put
my file on the same root as running the code in type of MDB.

Thanks.


"Mike Painter" wrote:

[Quoted Text]
> DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName, ObjectType,
> Source, Destination, StructureOnly, StoreLogin)is taken from the VB help
> file.
>
> You would replace DataBase Type with "dBase III ", "dBase IV ", "dBase 5.0"
>
> *IF* the .DBF file is in one of those formats. If not you might have to use
> TransferText
>
> Yours would look like
> DoCmd.TransferDatabase acImport, "dBase III", _
> "C:\MyDataBase.DBF", acReport, "NW Sales for April", _
> "Corporate Sales for April"
>
> ooxx wrote:
> > Hi,
> >
> > Hi holey.. excuse me.
> >
> > My question is :
> > I want to import file type .DBF by using VBA code. Can any body show
> > me some examples?
> >
> > Thanks,
>
>
>
Re: DoCmd.TransferDatabase
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 11/10/2008 5:56:01 AM
DBF files are typically flat file tables. It was used by dBase originally
and I've never seen a .dbf extension that was not just a single table. The
table name is the file name.

As for your "c:/Ex.dbf" it should be c:\Ex.dbf" and that assumes that you in
fact have it in "C:"

That is fairly rare today. If you are just copying the information from the
example you should realize that "C:\MyDataBase.DBF" is just an example.
Something like "C:\Documents and Settings\YourUserName\My
Documents\Some.dbf" is far more likely.

ooxx wrote:
[Quoted Text]
> Hi ,
>
> Okey, as soon as I have tried the code you provided, Mike, it seems
> that it would work, but the code is unlike the the type of Ms Access
> database that it should point to the table or the "Table Name". Yes,
> DBF has no TableName. I have tried one in DBF type but not success.
>
> Another problem of me is when running the code in the type of Ms
> Access database the root to the DbName, the code know where to
> extract. On the same occassion, I do it on the DBF type, when
> running the code, it cann't, and shown up the message "c:/Ex.DBF is
> not a valid path", eventhough, I have put my file on the same root as
> running the code in type of MDB.
>
> Thanks.
>
>
> "Mike Painter" wrote:
>
>> DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName,
>> ObjectType, Source, Destination, StructureOnly, StoreLogin)is taken
>> from the VB help file.
>>
>> You would replace DataBase Type with "dBase III ", "dBase IV ",
>> "dBase 5.0"
>>
>> *IF* the .DBF file is in one of those formats. If not you might have
>> to use TransferText
>>
>> Yours would look like
>> DoCmd.TransferDatabase acImport, "dBase III", _
>> "C:\MyDataBase.DBF", acReport, "NW Sales for April", _
>> "Corporate Sales for April"
>>
>> ooxx wrote:
>>> Hi,
>>>
>>> Hi holey.. excuse me.
>>>
>>> My question is :
>>> I want to import file type .DBF by using VBA code. Can any body
>>> show me some examples?
>>>
>>> Thanks,


Re: DoCmd.TransferDatabase
ooxx 11/12/2008 3:31:01 AM
Hi,

I have tried and the outcome so gooood... for a time. But the time here, I
have one thing, I just want to know. With this code, DoCmd.TransferText
acImportDelim, , "MyTbl_Txta", "D:\GER\MDB\DB1\MyTxta.TXT", I 'd like to
shrink chars of field text to not more than 10 supposed, and to begin from
the 3rd letter supposed. Example of Field Txt: abCDEFGHIJKLmn opqrstuvwxyz,
so after extract the result in the field text would be : CDEFGHIJKL .

So, What would the solution here?



"Mike Painter" wrote:

[Quoted Text]
> DBF files are typically flat file tables. It was used by dBase originally
> and I've never seen a .dbf extension that was not just a single table. The
> table name is the file name.
>
> As for your "c:/Ex.dbf" it should be c:\Ex.dbf" and that assumes that you in
> fact have it in "C:"
>
> That is fairly rare today. If you are just copying the information from the
> example you should realize that "C:\MyDataBase.DBF" is just an example.
> Something like "C:\Documents and Settings\YourUserName\My
> Documents\Some.dbf" is far more likely.
>
> ooxx wrote:
> > Hi ,
> >
> > Okey, as soon as I have tried the code you provided, Mike, it seems
> > that it would work, but the code is unlike the the type of Ms Access
> > database that it should point to the table or the "Table Name". Yes,
> > DBF has no TableName. I have tried one in DBF type but not success.
> >
> > Another problem of me is when running the code in the type of Ms
> > Access database the root to the DbName, the code know where to
> > extract. On the same occassion, I do it on the DBF type, when
> > running the code, it cann't, and shown up the message "c:/Ex.DBF is
> > not a valid path", eventhough, I have put my file on the same root as
> > running the code in type of MDB.
> >
> > Thanks.
> >
> >
> > "Mike Painter" wrote:
> >
> >> DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName,
> >> ObjectType, Source, Destination, StructureOnly, StoreLogin)is taken
> >> from the VB help file.
> >>
> >> You would replace DataBase Type with "dBase III ", "dBase IV ",
> >> "dBase 5.0"
> >>
> >> *IF* the .DBF file is in one of those formats. If not you might have
> >> to use TransferText
> >>
> >> Yours would look like
> >> DoCmd.TransferDatabase acImport, "dBase III", _
> >> "C:\MyDataBase.DBF", acReport, "NW Sales for April", _
> >> "Corporate Sales for April"
> >>
> >> ooxx wrote:
> >>> Hi,
> >>>
> >>> Hi holey.. excuse me.
> >>>
> >>> My question is :
> >>> I want to import file type .DBF by using VBA code. Can any body
> >>> show me some examples?
> >>>
> >>> Thanks,
>
>
>
Re: DoCmd.TransferDatabase
"Klatuu" <david.hargis[ at ]realpage.com> 11/12/2008 3:31:28 PM
You will not be able to do that in the TransferText method. It is only for
moving data in and out of Access.
What you will need to do is use a temporary table that will accept the data
as is and use some queries to manipulate the data and populate your
production table with the reformed data.

"ooxx" <ooxx[ at ]discussions.microsoft.com> wrote in message
news:40FEB9AE-0FFA-4AB6-A615-3325A25951E7[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> I have tried and the outcome so gooood... for a time. But the time here, I
> have one thing, I just want to know. With this code, DoCmd.TransferText
> acImportDelim, , "MyTbl_Txta", "D:\GER\MDB\DB1\MyTxta.TXT", I 'd like to
> shrink chars of field text to not more than 10 supposed, and to begin from
> the 3rd letter supposed. Example of Field Txt: abCDEFGHIJKLmn
> opqrstuvwxyz,
> so after extract the result in the field text would be : CDEFGHIJKL .
>
> So, What would the solution here?
>
>
>
> "Mike Painter" wrote:
>
>> DBF files are typically flat file tables. It was used by dBase
>> originally
>> and I've never seen a .dbf extension that was not just a single table.
>> The
>> table name is the file name.
>>
>> As for your "c:/Ex.dbf" it should be c:\Ex.dbf" and that assumes that you
>> in
>> fact have it in "C:"
>>
>> That is fairly rare today. If you are just copying the information from
>> the
>> example you should realize that "C:\MyDataBase.DBF" is just an example.
>> Something like "C:\Documents and Settings\YourUserName\My
>> Documents\Some.dbf" is far more likely.
>>
>> ooxx wrote:
>> > Hi ,
>> >
>> > Okey, as soon as I have tried the code you provided, Mike, it seems
>> > that it would work, but the code is unlike the the type of Ms Access
>> > database that it should point to the table or the "Table Name". Yes,
>> > DBF has no TableName. I have tried one in DBF type but not success.
>> >
>> > Another problem of me is when running the code in the type of Ms
>> > Access database the root to the DbName, the code know where to
>> > extract. On the same occassion, I do it on the DBF type, when
>> > running the code, it cann't, and shown up the message "c:/Ex.DBF is
>> > not a valid path", eventhough, I have put my file on the same root as
>> > running the code in type of MDB.
>> >
>> > Thanks.
>> >
>> >
>> > "Mike Painter" wrote:
>> >
>> >> DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName,
>> >> ObjectType, Source, Destination, StructureOnly, StoreLogin)is taken
>> >> from the VB help file.
>> >>
>> >> You would replace DataBase Type with "dBase III ", "dBase IV ",
>> >> "dBase 5.0"
>> >>
>> >> *IF* the .DBF file is in one of those formats. If not you might have
>> >> to use TransferText
>> >>
>> >> Yours would look like
>> >> DoCmd.TransferDatabase acImport, "dBase III", _
>> >> "C:\MyDataBase.DBF", acReport, "NW Sales for April", _
>> >> "Corporate Sales for April"
>> >>
>> >> ooxx wrote:
>> >>> Hi,
>> >>>
>> >>> Hi holey.. excuse me.
>> >>>
>> >>> My question is :
>> >>> I want to import file type .DBF by using VBA code. Can any body
>> >>> show me some examples?
>> >>>
>> >>> Thanks,
>>
>>
>>


Re: DoCmd.TransferDatabase
ooxx 11/13/2008 8:30:00 AM
Hi,

Are you sure? I don't think so. Acess must prepare that as an argument for,
but I don't know how to.

What do you think?

Access shouldn't ignore that.



"Klatuu" wrote:

[Quoted Text]
> You will not be able to do that in the TransferText method. It is only for
> moving data in and out of Access.
> What you will need to do is use a temporary table that will accept the data
> as is and use some queries to manipulate the data and populate your
> production table with the reformed data.
>
> "ooxx" <ooxx[ at ]discussions.microsoft.com> wrote in message
> news:40FEB9AE-0FFA-4AB6-A615-3325A25951E7[ at ]microsoft.com...
> > Hi,
> >
> > I have tried and the outcome so gooood... for a time. But the time here, I
> > have one thing, I just want to know. With this code, DoCmd.TransferText
> > acImportDelim, , "MyTbl_Txta", "D:\GER\MDB\DB1\MyTxta.TXT", I 'd like to
> > shrink chars of field text to not more than 10 supposed, and to begin from
> > the 3rd letter supposed. Example of Field Txt: abCDEFGHIJKLmn
> > opqrstuvwxyz,
> > so after extract the result in the field text would be : CDEFGHIJKL .
> >
> > So, What would the solution here?
> >
> >
> >
> > "Mike Painter" wrote:
> >
> >> DBF files are typically flat file tables. It was used by dBase
> >> originally
> >> and I've never seen a .dbf extension that was not just a single table.
> >> The
> >> table name is the file name.
> >>
> >> As for your "c:/Ex.dbf" it should be c:\Ex.dbf" and that assumes that you
> >> in
> >> fact have it in "C:"
> >>
> >> That is fairly rare today. If you are just copying the information from
> >> the
> >> example you should realize that "C:\MyDataBase.DBF" is just an example.
> >> Something like "C:\Documents and Settings\YourUserName\My
> >> Documents\Some.dbf" is far more likely.
> >>
> >> ooxx wrote:
> >> > Hi ,
> >> >
> >> > Okey, as soon as I have tried the code you provided, Mike, it seems
> >> > that it would work, but the code is unlike the the type of Ms Access
> >> > database that it should point to the table or the "Table Name". Yes,
> >> > DBF has no TableName. I have tried one in DBF type but not success.
> >> >
> >> > Another problem of me is when running the code in the type of Ms
> >> > Access database the root to the DbName, the code know where to
> >> > extract. On the same occassion, I do it on the DBF type, when
> >> > running the code, it cann't, and shown up the message "c:/Ex.DBF is
> >> > not a valid path", eventhough, I have put my file on the same root as
> >> > running the code in type of MDB.
> >> >
> >> > Thanks.
> >> >
> >> >
> >> > "Mike Painter" wrote:
> >> >
> >> >> DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName,
> >> >> ObjectType, Source, Destination, StructureOnly, StoreLogin)is taken
> >> >> from the VB help file.
> >> >>
> >> >> You would replace DataBase Type with "dBase III ", "dBase IV ",
> >> >> "dBase 5.0"
> >> >>
> >> >> *IF* the .DBF file is in one of those formats. If not you might have
> >> >> to use TransferText
> >> >>
> >> >> Yours would look like
> >> >> DoCmd.TransferDatabase acImport, "dBase III", _
> >> >> "C:\MyDataBase.DBF", acReport, "NW Sales for April", _
> >> >> "Corporate Sales for April"
> >> >>
> >> >> ooxx wrote:
> >> >>> Hi,
> >> >>>
> >> >>> Hi holey.. excuse me.
> >> >>>
> >> >>> My question is :
> >> >>> I want to import file type .DBF by using VBA code. Can any body
> >> >>> show me some examples?
> >> >>>
> >> >>> Thanks,
> >>
> >>
> >>
>
>
>
Re: DoCmd.TransferDatabase
"AccessVandal via AccessMonster.com" <u18947[ at ]uwe> 11/13/2008 8:46:38 AM
I'm not sure that this link to Allen Browne's might help. Look at "Converting
from the old xBase".

http://allenbrowne.com/tips.html

ooxx wrote:
[Quoted Text]
>Hi,
>
>Are you sure? I don't think so. Acess must prepare that as an argument for,
>but I don't know how to.
>
>What do you think?
>
>Access shouldn't ignore that.

--
Please Rate the posting if helps you

Message posted via http://www.accessmonster.com

Re: DoCmd.TransferDatabase
"Klatuu" <david.hargis[ at ]realpage.com> 11/13/2008 1:48:50 PM
Yes, I am sure.

"ooxx" <ooxx[ at ]discussions.microsoft.com> wrote in message
news:AE2C4682-743C-4F89-9901-4974D9FA263B[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> Are you sure? I don't think so. Acess must prepare that as an argument
> for,
> but I don't know how to.
>
> What do you think?
>
> Access shouldn't ignore that.
>
>
>
> "Klatuu" wrote:
>
>> You will not be able to do that in the TransferText method. It is only
>> for
>> moving data in and out of Access.
>> What you will need to do is use a temporary table that will accept the
>> data
>> as is and use some queries to manipulate the data and populate your
>> production table with the reformed data.
>>
>> "ooxx" <ooxx[ at ]discussions.microsoft.com> wrote in message
>> news:40FEB9AE-0FFA-4AB6-A615-3325A25951E7[ at ]microsoft.com...
>> > Hi,
>> >
>> > I have tried and the outcome so gooood... for a time. But the time
>> > here, I
>> > have one thing, I just want to know. With this code,
>> > DoCmd.TransferText
>> > acImportDelim, , "MyTbl_Txta", "D:\GER\MDB\DB1\MyTxta.TXT", I 'd like
>> > to
>> > shrink chars of field text to not more than 10 supposed, and to begin
>> > from
>> > the 3rd letter supposed. Example of Field Txt: abCDEFGHIJKLmn
>> > opqrstuvwxyz,
>> > so after extract the result in the field text would be : CDEFGHIJKL .
>> >
>> > So, What would the solution here?
>> >
>> >
>> >
>> > "Mike Painter" wrote:
>> >
>> >> DBF files are typically flat file tables. It was used by dBase
>> >> originally
>> >> and I've never seen a .dbf extension that was not just a single table.
>> >> The
>> >> table name is the file name.
>> >>
>> >> As for your "c:/Ex.dbf" it should be c:\Ex.dbf" and that assumes that
>> >> you
>> >> in
>> >> fact have it in "C:"
>> >>
>> >> That is fairly rare today. If you are just copying the information
>> >> from
>> >> the
>> >> example you should realize that "C:\MyDataBase.DBF" is just an
>> >> example.
>> >> Something like "C:\Documents and Settings\YourUserName\My
>> >> Documents\Some.dbf" is far more likely.
>> >>
>> >> ooxx wrote:
>> >> > Hi ,
>> >> >
>> >> > Okey, as soon as I have tried the code you provided, Mike, it seems
>> >> > that it would work, but the code is unlike the the type of Ms Access
>> >> > database that it should point to the table or the "Table Name".
>> >> > Yes,
>> >> > DBF has no TableName. I have tried one in DBF type but not success.
>> >> >
>> >> > Another problem of me is when running the code in the type of Ms
>> >> > Access database the root to the DbName, the code know where to
>> >> > extract. On the same occassion, I do it on the DBF type, when
>> >> > running the code, it cann't, and shown up the message "c:/Ex.DBF is
>> >> > not a valid path", eventhough, I have put my file on the same root
>> >> > as
>> >> > running the code in type of MDB.
>> >> >
>> >> > Thanks.
>> >> >
>> >> >
>> >> > "Mike Painter" wrote:
>> >> >
>> >> >> DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName,
>> >> >> ObjectType, Source, Destination, StructureOnly, StoreLogin)is taken
>> >> >> from the VB help file.
>> >> >>
>> >> >> You would replace DataBase Type with "dBase III ", "dBase IV ",
>> >> >> "dBase 5.0"
>> >> >>
>> >> >> *IF* the .DBF file is in one of those formats. If not you might
>> >> >> have
>> >> >> to use TransferText
>> >> >>
>> >> >> Yours would look like
>> >> >> DoCmd.TransferDatabase acImport, "dBase III", _
>> >> >> "C:\MyDataBase.DBF", acReport, "NW Sales for April", _
>> >> >> "Corporate Sales for April"
>> >> >>
>> >> >> ooxx wrote:
>> >> >>> Hi,
>> >> >>>
>> >> >>> Hi holey.. excuse me.
>> >> >>>
>> >> >>> My question is :
>> >> >>> I want to import file type .DBF by using VBA code. Can any body
>> >> >>> show me some examples?
>> >> >>>
>> >> >>> Thanks,
>> >>
>> >>
>> >>
>>
>>
>>


Re: DoCmd.TransferDatabase
"Klatuu" <david.hargis[ at ]realpage.com> 11/13/2008 1:50:24 PM
I think I misread part of your original post.
If you have an odbc driver for DBase or Foxpro, you can connect to the dbf
as if it were a table and use a query to import the data.

"ooxx" <ooxx[ at ]discussions.microsoft.com> wrote in message
news:AE2C4682-743C-4F89-9901-4974D9FA263B[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> Are you sure? I don't think so. Acess must prepare that as an argument
> for,
> but I don't know how to.
>
> What do you think?
>
> Access shouldn't ignore that.
>
>
>
> "Klatuu" wrote:
>
>> You will not be able to do that in the TransferText method. It is only
>> for
>> moving data in and out of Access.
>> What you will need to do is use a temporary table that will accept the
>> data
>> as is and use some queries to manipulate the data and populate your
>> production table with the reformed data.
>>
>> "ooxx" <ooxx[ at ]discussions.microsoft.com> wrote in message
>> news:40FEB9AE-0FFA-4AB6-A615-3325A25951E7[ at ]microsoft.com...
>> > Hi,
>> >
>> > I have tried and the outcome so gooood... for a time. But the time
>> > here, I
>> > have one thing, I just want to know. With this code,
>> > DoCmd.TransferText
>> > acImportDelim, , "MyTbl_Txta", "D:\GER\MDB\DB1\MyTxta.TXT", I 'd like
>> > to
>> > shrink chars of field text to not more than 10 supposed, and to begin
>> > from
>> > the 3rd letter supposed. Example of Field Txt: abCDEFGHIJKLmn
>> > opqrstuvwxyz,
>> > so after extract the result in the field text would be : CDEFGHIJKL .
>> >
>> > So, What would the solution here?
>> >
>> >
>> >
>> > "Mike Painter" wrote:
>> >
>> >> DBF files are typically flat file tables. It was used by dBase
>> >> originally
>> >> and I've never seen a .dbf extension that was not just a single table.
>> >> The
>> >> table name is the file name.
>> >>
>> >> As for your "c:/Ex.dbf" it should be c:\Ex.dbf" and that assumes that
>> >> you
>> >> in
>> >> fact have it in "C:"
>> >>
>> >> That is fairly rare today. If you are just copying the information
>> >> from
>> >> the
>> >> example you should realize that "C:\MyDataBase.DBF" is just an
>> >> example.
>> >> Something like "C:\Documents and Settings\YourUserName\My
>> >> Documents\Some.dbf" is far more likely.
>> >>
>> >> ooxx wrote:
>> >> > Hi ,
>> >> >
>> >> > Okey, as soon as I have tried the code you provided, Mike, it seems
>> >> > that it would work, but the code is unlike the the type of Ms Access
>> >> > database that it should point to the table or the "Table Name".
>> >> > Yes,
>> >> > DBF has no TableName. I have tried one in DBF type but not success.
>> >> >
>> >> > Another problem of me is when running the code in the type of Ms
>> >> > Access database the root to the DbName, the code know where to
>> >> > extract. On the same occassion, I do it on the DBF type, when
>> >> > running the code, it cann't, and shown up the message "c:/Ex.DBF is
>> >> > not a valid path", eventhough, I have put my file on the same root
>> >> > as
>> >> > running the code in type of MDB.
>> >> >
>> >> > Thanks.
>> >> >
>> >> >
>> >> > "Mike Painter" wrote:
>> >> >
>> >> >> DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName,
>> >> >> ObjectType, Source, Destination, StructureOnly, StoreLogin)is taken
>> >> >> from the VB help file.
>> >> >>
>> >> >> You would replace DataBase Type with "dBase III ", "dBase IV ",
>> >> >> "dBase 5.0"
>> >> >>
>> >> >> *IF* the .DBF file is in one of those formats. If not you might
>> >> >> have
>> >> >> to use TransferText
>> >> >>
>> >> >> Yours would look like
>> >> >> DoCmd.TransferDatabase acImport, "dBase III", _
>> >> >> "C:\MyDataBase.DBF", acReport, "NW Sales for April", _
>> >> >> "Corporate Sales for April"
>> >> >>
>> >> >> ooxx wrote:
>> >> >>> Hi,
>> >> >>>
>> >> >>> Hi holey.. excuse me.
>> >> >>>
>> >> >>> My question is :
>> >> >>> I want to import file type .DBF by using VBA code. Can any body
>> >> >>> show me some examples?
>> >> >>>
>> >> >>> Thanks,
>> >>
>> >>
>> >>
>>
>>
>>


Re: DoCmd.TransferDatabase
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 11/13/2008 6:20:59 PM
If it delimited then you can't do it.
If it is fixed length you can.
There is no compelling reason to expect that what was important in one
database would not be important in the next.

Import it and run a query that uses the Mid function to pick the information
you need.

And, yes, we are sure.

ooxx wrote:
[Quoted Text]
> Hi,
>
> Are you sure? I don't think so. Acess must prepare that as an
> argument for, but I don't know how to.
>
> What do you think?
>
> Access shouldn't ignore that.
>
>
>
> "Klatuu" wrote:
>
>> You will not be able to do that in the TransferText method. It is
>> only for moving data in and out of Access.
>> What you will need to do is use a temporary table that will accept
>> the data as is and use some queries to manipulate the data and
>> populate your production table with the reformed data.
>>
>> "ooxx" <ooxx[ at ]discussions.microsoft.com> wrote in message
>> news:40FEB9AE-0FFA-4AB6-A615-3325A25951E7[ at ]microsoft.com...
>>> Hi,
>>>
>>> I have tried and the outcome so gooood... for a time. But the time
>>> here, I have one thing, I just want to know. With this code,
>>> DoCmd.TransferText acImportDelim, , "MyTbl_Txta",
>>> "D:\GER\MDB\DB1\MyTxta.TXT", I 'd like to shrink chars of field
>>> text to not more than 10 supposed, and to begin from the 3rd letter
>>> supposed. Example of Field Txt: abCDEFGHIJKLmn opqrstuvwxyz,
>>> so after extract the result in the field text would be : CDEFGHIJKL
>>> .
>>>
>>> So, What would the solution here?
>>>
>>>
>>>
>>> "Mike Painter" wrote:
>>>
>>>> DBF files are typically flat file tables. It was used by dBase
>>>> originally
>>>> and I've never seen a .dbf extension that was not just a single
>>>> table. The
>>>> table name is the file name.
>>>>
>>>> As for your "c:/Ex.dbf" it should be c:\Ex.dbf" and that assumes
>>>> that you in
>>>> fact have it in "C:"
>>>>
>>>> That is fairly rare today. If you are just copying the information
>>>> from the
>>>> example you should realize that "C:\MyDataBase.DBF" is just an
>>>> example. Something like "C:\Documents and Settings\YourUserName\My
>>>> Documents\Some.dbf" is far more likely.
>>>>
>>>> ooxx wrote:
>>>>> Hi ,
>>>>>
>>>>> Okey, as soon as I have tried the code you provided, Mike, it
>>>>> seems that it would work, but the code is unlike the the type of
>>>>> Ms Access database that it should point to the table or the
>>>>> "Table Name". Yes, DBF has no TableName. I have tried one in DBF
>>>>> type but not success.
>>>>>
>>>>> Another problem of me is when running the code in the type of Ms
>>>>> Access database the root to the DbName, the code know where to
>>>>> extract. On the same occassion, I do it on the DBF type, when
>>>>> running the code, it cann't, and shown up the message "c:/Ex.DBF
>>>>> is not a valid path", eventhough, I have put my file on the same
>>>>> root as running the code in type of MDB.
>>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>> "Mike Painter" wrote:
>>>>>
>>>>>> DoCmd.TransferDatabase(TransferType, DatabaseType, DatabaseName,
>>>>>> ObjectType, Source, Destination, StructureOnly, StoreLogin)is
>>>>>> taken from the VB help file.
>>>>>>
>>>>>> You would replace DataBase Type with "dBase III ", "dBase IV ",
>>>>>> "dBase 5.0"
>>>>>>
>>>>>> *IF* the .DBF file is in one of those formats. If not you might
>>>>>> have to use TransferText
>>>>>>
>>>>>> Yours would look like
>>>>>> DoCmd.TransferDatabase acImport, "dBase III", _
>>>>>> "C:\MyDataBase.DBF", acReport, "NW Sales for April", _
>>>>>> "Corporate Sales for April"
>>>>>>
>>>>>> ooxx wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Hi holey.. excuse me.
>>>>>>>
>>>>>>> My question is :
>>>>>>> I want to import file type .DBF by using VBA code. Can any body
>>>>>>> show me some examples?
>>>>>>>
>>>>>>> Thanks,


Re: DoCmd.TransferDatabase
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 11/13/2008 6:23:10 PM
Klatuu wrote:
[Quoted Text]
> I think I misread part of your original post.
> If you have an odbc driver for DBase or Foxpro, you can connect to
> the dbf as if it were a table and use a query to import the data.
>
>>>> DoCmd.TransferText
>>>> acImportDelim, , "MyTbl_Txta", "D:\GER\MDB\DB1\MyTxta.TXT",

You seem to have responded correctly to a second question as this appears to
be a delimited file.


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net