Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 16th, 2006, 09:23 AM
Authorized User
 
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, i'm so use to doing conn.execute that I often forget about adding records that way. I need to mod it alil then I'll get back to you on how it works... you are a big help. Thnx

 
Old May 16th, 2006, 09:25 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am still not clear on the structure of the data, though. If each #-@ is a seperate reading from the wrench, then each line would have multiple records, instead of each line having one record. So that makes a difference in how you shove the data into the table. Please clarify.

mmcdonal
 
Old May 16th, 2006, 11:49 AM
Authorized User
 
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cna I count the amount of arrarys there are that have values?

intx = arrary(x).count or something like that?

 
Old May 16th, 2006, 11:57 AM
Authorized User
 
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by mmcdonal
 I am still not clear on the structure of the data, though. If each #-@ is a seperate reading from the wrench, then each line would have multiple records, instead of each line having one record. So that makes a difference in how you shove the data into the table. Please clarify.

mmcdonal
I wish I can contructed the data file myself but the engineers here are using a generic hyperterminal app called Tera Term Pro. It logs data in one long line. Then they call me and tell me to make heads or tails of it. Max measurements should be 20 hopefully. If I could attach the file so you could see it I would.

 
Old May 16th, 2006, 12:03 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You use UBound(MyArray) which returns a numeric value of the number of elements. Remember to add 1 since it starts at 0.

So if UBound(MyArray) = 2, there are 3 elements: 0, 1, 2.



mmcdonal
 
Old May 16th, 2006, 12:40 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What I need to know is, in the first line that you showed me, what will you be storing and where?

mmcdonal
 
Old May 16th, 2006, 12:51 PM
Authorized User
 
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'll be storing Torque values and in an access database for weekly reports on value that where torqued High/Low.

 
Old May 16th, 2006, 01:01 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I get it. You will then need to store the date and time the data was retrieved. Are any of the values in the data date and time stamp data? Which part of the data is torque spec, wrench id, date and time, if any? That would be ideal. Otherwise you will just stamp the time the process was run.



mmcdonal
 
Old May 16th, 2006, 01:16 PM
Authorized User
 
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The app called Tera Term that actually gets the data from the wrench stores the data for each wrench in a diff file. IE: Toola, Toolb, Toolc. The form I'm creating will add generate a random record ID and store the record for each transmission in Table Toola, Toolb, and Toolc all with same record ID and date/time stamp.

 
Old May 16th, 2006, 01:29 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

So what you will need to do is to create a table with an autonumber field, the data field from the file, and the date/time. So Toola table should look like this:

tblToolA
ToolaID - auto: PK
Data - text: 12005055.00000000441526
DateTime - date: Now()

Also, it sounds like each line has, in this case, 12 records. So the line you posted needs to be split into 12 parts, then each of those 12 parts has to have its own record, with PK, data, and datetime. If that is the case, then the code I posted needs another nested loop.

Are we getting closer? It is all very easy if we have the requirements right.



mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database import CVCgrad SQL Server 2005 4 September 19th, 2007 01:33 PM
Text Import- How to import the first 5 lines. nickzhang.zn Excel VBA 1 August 4th, 2007 05:06 PM
Import Error. lafilip Flash (all versions) 1 January 5th, 2007 01:12 AM
how to import from the same file kgoldvas XSLT 1 February 14th, 2006 06:45 AM
import to access midtowncreek Access 5 June 30th, 2004 01:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.