[AccessD] Load from test AGAIN

James Barash James at fcidms.com
Wed Oct 18 14:55:47 CDT 2006


Martin:

I think your problem is the name of the Object you are trying to create.
>From the code below, you are trying to create an object called "Customer
Details.txt". You need to strip the .txt from the strTemp. 
Something like:

Application.LoadFromText acForm, Left(Mid(strTemp, InStr(1, strTemp, "_",
vbTextCompare) + 1), Len(Mid(strTemp, InStr(1, strTemp, "_", vbTextCompare)
+ 1)) - 4), "C:\" & strTemp

I would still strip out the spaces in the Object name but the above code
should work correctly.

Hope that helps.

James Barash

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin Reid
Sent: Wednesday, October 18, 2006 3:26 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Load from test AGAIN

No joy folks.
 
Did the quotes wrote a function that stripped the spaces and still errors.
 
I am screwing up here somewhere.
 
Maritn
 
Martin WP Reid
Training and Assessment Unit
Riddle Hall
Belfast
 
tel: 02890 974477
 

________________________________

From: accessd-bounces at databaseadvisors.com on behalf of Bobby Heid
Sent: Wed 18/10/2006 20:08
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Load from test AGAIN



Martin, 

Could it be that you need to surround the whole file path+file name with
quotes?  There are spaces in your file name.

Maybe:
    Application.LoadFromText acForm, Mid(strTemp, InStr(1, strTemp, "_",
vbTextCompare) + 1), "'C:\forms\" & strTemp & "'"

Just a WAG.

Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin Reid
Sent: Wednesday, October 18, 2006 2:47 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Load from test AGAIN


Its fails on this line

    Application.LoadFromText acForm, Mid(strTemp, InStr(1, strTemp, "_",
vbTextCompare) + 1), "C:\forms\" & strTemp

strTemp has the value Form_Customer Details.txt coming into the loop


Never gets past this.

The error is

The object name 'Customer Details.txt' does not follow Microsoft Access
object naming rules

I get the feeling the answer is staring me in the face here.

If I do a simple application.LoadFromText then its not a problem.

But if I have 500 objects I would like to automate the process and just grab
them all.



Martin




Martin WP Reid
Training and Assessment Unit
Riddle Hall
Belfast

tel: 02890 974477


________________________________

From: accessd-bounces at databaseadvisors.com on behalf of Charlotte Foust
Sent: Wed 18/10/2006 19:34
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Load from test AGAIN



You don't give any specifics on where your problem occurs, Martin.  Is
it in the file system object handling, the LoadFromText, or what?  I've
usually had fewer problems with any kind of iterative operation on files
when I created an array of the filenames (with or without extensions) to
be retrieved using Dir or file system object and then passed that into a
routine to do the actual handling, with some kind of test in place to
see if one item has succeeded before passing in another item.

Charlotte Foust

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin Reid
Sent: Wednesday, October 18, 2006 11:11 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Load from test AGAIN

Ok this has me beat

No matter what I try I cant get it to loop through a folder and import
the exported text files. Tried Martys stuff, Drews stuff and my own.
Used file system object to return only the file name without the
extension and no luck.

Any help greatly appreciated.

background

Access database objects exported as text files into C\|Forms

I think need to LoadFromText all the objects in said folder back into
database.

This cannot be as difficult as it seems. One at a time and naming the
files it works. Only when I go to look through all the objects does it
fail. This is almost my last example file I need and its melting my
head.


Martin



Martin WP Reid
Training and Assessment Unit
Riddle Hall
Belfast

tel: 02890 974477

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com/> 






More information about the AccessD mailing list